[TriLUG] back up your $HOME

Alan Porter porter at trilug.org
Tue May 24 15:25:28 EDT 2011

As part of the annual changing of the guard, the steering committee was
recently reviewing our wiki notes that describe our gear at Sungard.

The topic of backups came up.

For the past several years, our standard practice has been to back up
the OS partitions, but to let users be responsible for backing up their
own home directories (which also includes their IMAP email storage).

The main reason behind NOT backing up /home is that our backup server
(dargo) does not have anywhere near as much disk space as our main
server (pilot), and so there is just no good place to keep the backups. 
We might address this if we can score new hardware, but in the meantime,
users are responsible for their own backups.

Personally, I back up my TriLUG home directory using a simple rsync
script on my fileserver at home.  It looks like this:

if [ $(id -u) -ne 0 ] ; then echo "not root" ; exit ; fi
cd /backup
date > $site.log
mkdir -p $site/$user
rsync -e "ssh -i keys/trilug-backup.pri" -xavz --delete --numeric-ids
--bwlimit=25 $user@$machine:./ $site/$user/ >> $site.log
date >> $site.log

The only tricky bit above is the "-e" clause on rsync.  That's just so I
can use an SSH key other than the one in ~root/.ssh .  I generated it
using "ssh-keygen -t rsa -P '' -f /backup/keys/trilug-backup", and I
copied the public key over to pilot using "ssh-copy-id -i
/backup/keys/trilug-backup porter at login.trilug.org".  I tested the keys
out using "ssh -i /backup/keys/trilug-backup porter at login.trilug.org".

The "bwlimit" option is nice, too... it keeps the transfer rate nice and

I set up a cron job that runs this every so often.  I do it nightly at 3am.
00 03 * * 0-6  /backup/trilug.sh

Just thought I'd share this... it just takes a few minutes to set up,
and then it runs every night.  Enjoy.



More information about the TriLUG mailing list