Example 3: Make a big backup once a week, a small every day

Now you will configure a big backup of the whole machine with exceptDirs and the small one of some special directories with the option follow links. Naturally, you can also configure it the other way round, only use followLinks for both or use includeDirs.

Let's assume, you want to do:

  1. Your machine mounts from other servers directory /net which you do not want to backup.
  2. You also do not want to save /tmp and /var/tmp.
  3. You want to backup the whole machine once a week to /net/server/backup/weekly.
  4. You want to backup /home/jim and /home/tom/texts to /net/server/backup/daily more quickly after you finished your work.
  5. Naturally, you want to share files between the two backup series
  6. If you start both scripts at the same time, then new files will not be shared between these two. But over time, this will come together. But you should not start both backups at the same time when you start them for the very first time! In this case, all your files will not be shared!
  7. You do not want to use option lateLinks, which would speed up your backups massively, because you cannot run scripts on the nfs server (or for whatever other reason).

To prepare the steps described above, you need to do the following:
For the daily backup, make a special directory (we use followLinks) like described in example 2 (you also stored storeBackup in /opt/storeBackup in this example):

# mkdir /opt/small-backup
# cd /opt/small-backup
# ln -s . small-backup
# ln -s /home/jim home_jim
# ln -s /home/tom/texts home_tom_texts

and write a backup script byBackup.sh:

#! /bin/sh
/opt/storeBackup/bin/storeBackup.pl -s /opt/small-backup
    -b /net/server/backup \
    -S daily -l /tmp/storeBackup.log --followLinks 1 0:weekly

Then write a script for the weekly backup:

#! /bin/sh
/opt/storeBackup/bin/storeBackup.pl -s / -b /net/server/backup -S weekly \
    -l /tmp/storeBackup.log --exceptDirs net -e tmp -e var/tmp \
    -e proc -e sys -e dev 0:daily

The ``0'' before the paths (like 0:daily) means to take the last backup of the other backup series to check for identical files.

And - naturally - the directories weekly and daily must exist inside of /net/server/backup on the NFS server.

As you can see, using command line options begin to be a little bit confusing. When configuring such examples, you should try to generate a configuration file with storeBackup.pl -g configFile and to use that instead.

Heinz-Josef Claes 2014-04-20