Backups
February 10, 2007
Well, backups are working. Every night my PowerMac G5 backs its important stuff up to external disks, and then a few hours later rowla.nuxx.net shoves its important bits down to one of the disks. It’d be better if it was all sent offsite, but I do only have a certain amount of space available remotely.
what software are you using for the backups?
just like a crontab/rsync thing, or external software?
/usr/bin/rsync ;)
Oh, and kicked off by cron at around 3:30am. The script is as follows:
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
# If /Volumes/Charlie exists, start backing stuff up to it.
if [ -d /Volumes/Charlie ]; then
#echo Found Charlie...
# Everything on Beta...
#echo rsync -a --delete --exclude '/.Trashes' --exclude '/.Spotlight-V100' --exclude '/Unison' /Volumes/Beta/. /Volumes/Charlie/Beta/.
rsync -aq --copy-links --ignore-errors --delete --exclude '/.Trashes' --exclude '/.Spotlight-V100' --exclude '/Unison' /Volumes/Beta/. /Volumes/Charlie/Beta/.
# ~c0nsumer, except for ~/Music
#echo rsync -a --delete --exclude '/Music/*' /Users/c0nsumer/. /Volumes/Charlie/c0nsumerHome/.
rsync -aq --copy-links --ignore-errors --delete --exclude '/Music/*' --exclude '/Library/Application Support/Unison' /Users/c0nsumer/. /Volumes/Charlie/c0nsumerHome/.
fi
# If /Volumes/Delta exists, back more stuff up to it.
if [ -d /Volumes/Delta ]; then
#echo Found Delta...
# ~c0nsumer/Music
#echo rsync -a --delete /Users/c0nsumer/Music/. /Volumes/Delta/Music/.
rsync -aq --copy-links --delete /Users/c0nsumer/Music/. /Volumes/Delta/Music/.
The stuff from remote is just sent down to home.nuxx.net which has port forwards in place to make ssh connections end at the G5.
[bookmarking this]
On the subject of backups, this is what I use for most of ofdoom.
Mail and the database get special treatment, so I have the nodump flag set for them.
#! /bin/sh LEVEL=$1 DATESTAMP=$(date "+%G.%m.%d") PIPE=/tmp/aPipe.$$ mkfifo -m 600 ${PIPE} for SYSTEM in root:/dev/ad0s1a usr:/dev/vinum/usr home:/dev/vinum/home ; do MP=$(echo ${SYSTEM} | cut -f1 -d:) DEV=$(echo ${SYSTEM} | cut -f2 -d:) FILE=${MP}.${DATESTAMP}.level${LEVEL}.dump cat ${PIPE} | ssh -2 -C -c blowfish -p 2222 archives@archive_host "cat - > /Users/archives/backups/dumps/${FILE}" & /sbin/dump -${LEVEL} -a -C 32 -h 0 -f ${PIPE} -u ${DEV} sleep 1 done rm ${PIPE}%