[clug] backup script?

Chris Smart mail at christophersmart.com
Sat Aug 30 00:10:40 GMT 2008

2008/8/30 Paul <mylists at wilsononline.id.au>:
> I've been wanting to figure out the best backup method, which in my opinion
> revolves around easiest restore method.
> I've just had to replace a HDD recently so this bumped this up the priority
> list.

Hey Paul,

I like to use rsync and hardlinks. That might work for you too. One
initial backup, the size of your data, then incrementals thereafter.
Your backups are live this way too, so you can share them out
read-only to a network and people can grab their latest files without
bothering you.

You just need two files, the backup script and a file to tell rsync
what to exclude from backup. Put them in /root/scripts/backup/ (or
change the location in the script) and make them executable.

Backup script (dailycheck):

Exclude file (exclude):

By default it wants to backup *to* /mnt/backup, so just create this
directory and/or mount a partition there.
All you should have to do is edit the directories that you want to
backup at the bottom of the dailycheck script (I'm backing up home,
data, etc, and var/www).

I also have a version that checks that an external harddrive is
mounted before proceeding and emails errors, and another that backups
multiple servers - but this should get you started if you like the
idea :)


More information about the linux mailing list