This script uses GNU tar and
gzip to create incremental backups.
installation
- copy the backup-script somewhere to in your path (e.g. /usr/local/bin)
- create a directory where you want to store your backup
- in this directory, create a file `hostname` (i.e. a file named like your hostname) with all the paths you want to backup. Here's an example:
/etc/
/var/lib/portage/world
/usr/src/linux/.config
/lib/modules/
/wurscht/
/root/
/var/log
/usr/local/portage
/public/
/home/
/boot/
/public/spiele/elasto/
/opt/foldingathome/
- optional: create a file `hostname`-X with all the exceptions:
/public/filme
/public/freenet
/public/spiele
/public/movies/torrent
/public/temp
/public/burn
/public/mldonkey
/public/cvs
/home/*/.galeon/favicon_cache
/home/*/.galeon/mozilla/galeon/Cache
/home/*/.pan
/home/*/.phoenix
/home/*/.mozilla
/home/*/.thumbnails
/home/*/.gnupg
/home/*/tmp
/etc/gconf
/etc/sound
usage
To start a backup, change into the backup-directory and start the script.
The backups have to be restored in the order they were created,
and you have to give the corresponding .incremental-file for
every generation.
tar xzg herzeleid.07-04-16.incremental herzeleid.07-04-16-full.tgz
tar xzg herzeleid.07-04-18.incremental herzeleid.07-04-18.tgz
tar xzg herzeleid.07-04-19.incremental herzeleid.07-04-19.tgz
etc.
If you only need one file, the procedure is a bit easier. You
can grep in the logfiles to find the archive the file
is in, then just extract it without any special
parameters. Only the file-
list is incremental,
all files that changed since the last backup are stored
in full.
miscellaneous
- if no full-backup exists, it will create one
- if a full backup exists, it does an incremental
backup
- the "*.incremental"-files are used by tar to save
information about the incremental backup
- filenames are stored without the leading "/" (and have to be restored this way)
- tar is sloooow.
download
download the
backup-script
there is a
wrapper-script for cron. This
one has to be adapted to your needs.