poor man’s TimeMachine backup by falko
7 01 2009If you don’t have MacOS X 10.5 (Leopard) but as well starving for a nice and easy backup then try this shell script. MacOS X provides some simple command line tools for doing a convinient backup out of the box. I wrote a little shell script which sports RSYNC to do regular backups and even archive deleted files for a certain time.
Simply modify your source and destination folder in this script and call it regularly. This can be done with cron. Your contrab entry should look something like this:
0 */2 * * * /Users/youraccount/pmt.sh > /dev/null 2>&1
This will start the script every full 2 hours. Should be sufficient.
#!/bin/bash # poor man's timemachine backup script # Author: # $Date: 2009-01-07 13:46:08 +0100 (Wed, 07 Jan 2009) $ # $Author: fzurell $ # $Revision: 93 $ # $HeadURL: http://fzurell@svn.explain-it.org/trunk/tools/pmt.sh $ # this is where your backup will go # hence the special character " " ... must be quoted with \ BACKUPDIR=/Volumes/Time\ Machine/pmt # This is the folder where the Backup should start from # it will be backed up recursivly SOURCE=/Users/fzurell/Music #################################################################### LANG=de_DE.UTF-8 WDAY=`date +%A` MDAY=`date +%d` # if you call this script without any parameter # then deleted files will be archived for one week # you can optionally choose to keep them one month case $1 in "woche") BDAY=$WDAY ;; "monat") BDAY=$MDAY ;; "--help") echo "Usage: $0 [woche | monat]" exit 10 ;; *) BDAY=$WDAY ;; esac if [ ! -d "$BACKUPDIR" ]; then exit 1 fi /usr/bin/rsync -a -q --delete -b --backup-dir="$BACKUPDIR/$BDAY" "$SOURCE" "$BACKUPDIR/BACKUP" if [ $? -eq 0 ]; then say "Your Backup finished successfully." else say "Sorry, there went something wrong with your Backup." fi
Comments : No Comments »
Categories : Geeky, Software
Tags: Backup, rsync, timemachine








