Backup script. Uses dump(8) and splits level 0 backup into multiple
volumes that can be burned to CDs. It can automatically mount
remote NFS filesystems. Developed on FreeBSD but should work on
other *nixes as well. Known to work out of the box on FreeBSD and Linux,
but see Linux notes below.
Written in Bourne shell. Current version is baak 1.0 [2003-01-30].
[download]
Usage: baak [-h] -l level -d targetdir filesystem
-h this help message
-l dump level
-d target directory where backup volumes go
(e.g. /tmp or nfshost:/backup)
I'm starting it automatically via cron(8). The idea is that level 0 dump
is done monthly and burned to CDs. Then there are weekly
level 4 dumps where only difference with respect to monthly dump is saved.
Finally there are daily level 8 dump. So, my crontab(1) looks like this:
0 3 1 * * baak -l 0 -d remote.hr:/backup /home
0 4 * * 7 baak -l 4 -d remote.hr:/backup /home
0 5 * * * baak -l 8 -d remote.hr:/backup /home
Note that dump(8) dumps only whole filesystems. If you want some files or
directories excluded, set their UP_NODUMP flag using chflags(1) or
chattr(1).
If you want to backup only some particular directory, use tar or afio or
something similar.
To restore, use
# restore -v -i -f /path/to/backupfile.1
Linux notes
On Linux, it seems to be necessary to work your way forward from the first
to the last volume of the mulitvolume archive (as opposed to the backward
procedure suggested in restore(8) documentation). You can use the
option "-M" available for Linux restore(8) but then you should rename
(or link) your backup files to prefix001, prefix002 etc. and then:
# restore -v -i -M -f prefix
Then, one should not try to restore Linux dumps using FreeBSD restore
or vice versa. And finaly, note that dump(8) doesn't work properly with
reiserfs filesystems. I tested only on ext2 and ext3.
|