incremental backups with tar

This script uses GNU tar and gzip to create incremental backups.


  1. copy the backup-script somewhere to in your path (e.g. /usr/local/bin)
  2. create a directory where you want to store your backup
  3. 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:
  4. optional: create a file `hostname`-X with all the exceptions:


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

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.



download the backup-script
there is a wrapper-script for cron. This one has to be adapted to your needs.