This commit is contained in:
Jeffrey Paul 2012-12-19 01:17:00 +01:00
parent 47a0f41e2e
commit 43ab9629f2
2 changed files with 8 additions and 22 deletions

View File

@ -1,11 +1,12 @@
JUNKFILES = .bash_history .irb_history .pip .ScanSnap .nbems .fldigi .cpan JUNKFILES = .bash_history .irb_history .pip .ScanSnap .nbems .fldigi .cpan
JUNKFILES += .gdb_history .mysql_history .sqlite_history JUNKFILES += .gdb_history .mysql_history .sqlite_history
YYYYMM := $(shell date +%Y%m)
default: backup default: backup
backup: clean backup: clean
@mbsync -X eeqjgmail mbsync eeqjgmail
@mbsync -X acidhousegmail mbsync acidhousegmail
-rsync -avPhz --delete sneak@datavibe.net:.maildir/ \ -rsync -avPhz --delete sneak@datavibe.net:.maildir/ \
$(HOME)/Documents/Secure/datavibe.maildir/ $(HOME)/Documents/Secure/datavibe.maildir/
@internalbackup.command # to 1tb @internalbackup.command # to 1tb
@ -16,6 +17,8 @@ clean:
-rm -rfv ~/Library/Caches/* -rm -rfv ~/Library/Caches/*
-rm -rfv ~/.Trash/* -rm -rfv ~/.Trash/*
-rm -rfv $(JUNKFILES) -rm -rfv $(JUNKFILES)
-mkdir -p $(HOME)/Documents/$(YYYYMM)
-mv $(HOME)/Desktop/* $(HOME)/Documents/$(YYYYMM)
size: size:
du -sh $(HOME) du -sh $(HOME)

View File

@ -9,12 +9,10 @@ NOW="`date +%Y%m%d.%H%M%S`"
BACKUPDEST=${BACKUPDEST:-"${USER}@jfk1.datavibe.net:backup/"} BACKUPDEST=${BACKUPDEST:-"${USER}@jfk1.datavibe.net:backup/"}
RSYNC="/usr/bin/rsync" RSYNC="rsync.3.0.9"
OPTS="-rlptDPSyzh --no-owner --no-group --delete-excluded --delete" OPTS="-rlptDPSyzh --no-owner --no-group --delete-excluded --delete"
RE="" RE=""
# Dropbox syncs itself just fine:
RE+=" --exclude=/Documents/Dropbox/"
RE+=" --exclude=/Desktop/" # desktop is like a visible tempdir. RE+=" --exclude=/Desktop/" # desktop is like a visible tempdir.
RE+=" --exclude=/Library/Safari/" RE+=" --exclude=/Library/Safari/"
RE+=" --exclude=/Downloads/" RE+=" --exclude=/Downloads/"
@ -25,6 +23,7 @@ RE+=" --exclude=/Library/Application?Support/InsomniaX/"
RE+=" --exclude=/Music/iTunes/Album?Artwork/" RE+=" --exclude=/Music/iTunes/Album?Artwork/"
RE+=" --exclude=/Documents/Steam?Content/" RE+=" --exclude=/Documents/Steam?Content/"
RE+=" --exclude=/.dropbox/" RE+=" --exclude=/.dropbox/"
RE+=" --exclude=/Documents/Dropbox/.dropbox.cache/"
RE+=" --exclude=/.cpan/build/" RE+=" --exclude=/.cpan/build/"
RE+=" --exclude=/.cpan/sources/" RE+=" --exclude=/.cpan/sources/"
RE+=" --exclude=/Library/Logs/" RE+=" --exclude=/Library/Logs/"
@ -34,6 +33,7 @@ RE+=" --exclude=/Library/Mail?Downloads/"
RE+=" --exclude=/Library/Application?Support/SecondLife/cache/" RE+=" --exclude=/Library/Application?Support/SecondLife/cache/"
RE+=" --exclude=/Library/Caches/" RE+=" --exclude=/Library/Caches/"
RE+=" --exclude=/Library/Developer/Xcode/DerivedData/" RE+=" --exclude=/Library/Developer/Xcode/DerivedData/"
RE+=" --exclude=/Library/Developer/Shared/Documentation/"
RE+=" --exclude=/Library/iTunes/iPhone?Software?Updates/" RE+=" --exclude=/Library/iTunes/iPhone?Software?Updates/"
RE+=" --exclude=/Library/iTunes/iPad?Software?Updates/" RE+=" --exclude=/Library/iTunes/iPad?Software?Updates/"
RE+=" --exclude=/Pictures/iPod?Photo?Cache/" RE+=" --exclude=/Pictures/iPod?Photo?Cache/"
@ -74,20 +74,3 @@ while [ $RETVAL -ne 0 ]; do
RETVAL=$? RETVAL=$?
sleep 1; sleep 1;
done done
if [ "${BACKUPDEST::16}" = "/Volumes/imac1tb" ]; then
echo "no need to backup to same disk"
exit 0
fi
BASE="/Volumes/imac1tb/sneak.data"
for DIR in Movies Pictures ; do
if [ -d "${BASE}/${DIR}/" ]; then
RETVAL=255
while [ $RETVAL -ne 0 ]; do
$RSYNC $OPTS "${BASE}/${DIR}/" "${BACKUPDEST}/${DIR}/"
RETVAL=$?
sleep 1;
done
fi
done