Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Comment Re:rsync, bash script, calendar event (Score 1) 125

i use a crontab to run a shell script using rsync for backups. the cronjob runs as root, and the backup volume is just an external firewire drive.

the -E option is probably a good idea also. add it if you want.

the script is designed to be run with stdout directed into a file, like such:

sh /Users/[you]/backup.sh >> /Volumes/Backup/backuplogs.txt
it keeps a log of backups and also makes a list of all your applications so you know what you had in case you ever have to start from scratch.

anyway, here's the script if anyone wants to give it a try!

#!/bin/bash
#dan criel's sweet backup script
 
echo Backup: && /bin/date
 
if [ ! -d "/Volumes/Backup/" ] ;
then
    echo Plug in the backup drive, dumbass!
    exit -1
fi
 
#rsync options: -a recurses, preserves links, etc.
# --delete removes files from destination that no longer
# exist at source
# ** trailing slash at the end of directory names is essential **
 
/usr/bin/rsync -a --delete /Library/ /Volumes/Backup/Library/
/usr/bin/rsync -a --delete /Users/ /Volumes/Backup/Users/
/bin/date > /Volumes/Backup/MyApps.txt
/bin/ls /Applications >> /Volumes/Backup/MyApps.txt
 
echo complete: && /bin/date
echo

Slashdot Top Deals

"In my opinion, Richard Stallman wouldn't recognise terrorism if it came up and bit him on his Internet." -- Ross M. Greenberg

Working...