backup-copy(1) is my backup script. It allows me to save a snapshot of my filesystem every day (or every minute, if I wanted to) with the complete tree of files saved every time - all at a cost of not more than about 2Mb/backup. The backup is mirrored on another file system, either local or remote (using ssh(1)). The backup directory looks like this:
.../backup-copy/hostname/2009/01/28-21_51
.../01/29-21_51
.../01/30-21_51
.../01/31-21_51
.../02/01-21_51
In other words, one directory per backup named with the date and time of the backup. This is done with rsync(1)'s wonderful ability to hard-link across directory trees - each file in each directory is hard-linked to the same file in the prior directory. Only files that have changed actually get a new file saved there.
The result is a tree of backups which are all copies of the source files at the time of backup - but only the changes 'cost' me in disc space and network bandwidth.
Some consequences:
backup-copy(1) needs an init file to direct the backup. The sample here .backup-copy.sample should give you an idea what to do.
.backup-copy.hostname with 'hostname' being the name of the system that is being backed up (without any dots or domainname)./var/backup-copy/HOSTNAME must exist - otherwise backup-copy(1) assumes you've made an error in the name of the destination directory and stops. You can force it to create that new directory with the -i option.** wildcard which means any directory - see the rsync(1) man page for full details.To use a remote destination just use the usual ssh(1) syntax eg surfers:/var. It's generally a good idea to push your ssh key to the remote machine otherwise you have to constantly provide a password - and you can't do that in unattended jobs eg in a crontab(1) job.