next up previous contents index
Next: A.2.7 How can I Up: A.2 How can I...? Previous: A.2.5 How can I

A.2.6 How can I do automatic backups?

Using the -auto-backup Config option, it is easy to perform automatic backups or use KBACKUP from a shell script. Just create a configuration, e.g. ``myAUTO'' and call KBACKUP like this:
kbackup --auto-backup myAUTO

Then it will perform a backup without asking you for anything. It is simple to create a short shell script to check for the right tape, e.g.

#!/bin/sh
mt rewind
tape_number=`cat /dev/tape`
required_tape_number=`cat /var/adm/tape_number`
if [ "$tape_number" != "$required_tape_number" ]
then
   exit 1;
fi
echo `expr $required_tape_number + 1` >/var/adm/tape_number
kbackup --auto-backup myAUTO

If you prepare a couple of tapes with one file on each of them, containing a serial number, this script can check whether the tape in the drive has the right serial number for the next backup. Of course, you need to prepare the tapes in advance and initialise the file for the serial number properly. With such a mechanism it is guaranteed, that you won't accidentally overwrite yesterday's backup.


next up previous contents index
Next: A.2.7 How can I Up: A.2 How can I...? Previous: A.2.5 How can I   Contents   Index
David Frascone
2000-10-13