Backups / Dump etc

Jerry McAllister jerrymc at
Fri Jan 14 10:11:23 PST 2005


> Hi,
> I'm looking around at backup solutions. Currently we are using bacula,
> but according to it's docs it only does a bare-metal restore for linux
> and solaris.
> I know that dump is the bees-knees for backing up, so I'm looking for
> any pre-made scripts for doing scheduled incremental backups with
> dump.. or articles about dump etc..

Yes, dump/restore is what you really want.

I will append a script we use for backing up one machine with dump to 
a DLT drive.  Some names are changed to protect the innocent (or guilty?).

Those are all full dumps, but it would not be very difficult
to have the script check the day of the week, and select the
dump level based on that.   On our operation which does not see
a great amount of change to files in each day, we find it reasonable
to do a full (level 0) dump and then just level 1 dumps in between.
The level 1 dumps never get very big in our case.  You may need
something that uses more levels if your files change more, but that
is not at all difficult.

> I've also been told that dump lacks network support and tho you can
> use -f and ssh, it's very slow.

Well, I have done backups using dump over the net, but it was
clumsy and used rhost.   There are other ways too, but all are
a bit slow.   Since your have tape drives handy, use them.

> We could use amanada, but it barfs [or used to] on disks that are 
> over 100 gigs.

We abandoned amanda as too unworkable.
Some of our stuff uses Arkeia, but it is not free.

> My issue here is software, not hardware, have a tape drive as well as
> a few 120gig drives kicking around.

Handy.   Tape is not as obsolete as some like to say it is.


> Thanks.
> -- 
> Jeff MacDonald

A script:
NOTE:  that the first record put on the tape is just a little text 
       file with a hand made index of the files on the tape and the 
       date of the dump.   That way it is easy to just cat the device
       and see what it is if we need.  Note also that I do a final
       write to that header file and leave it on disk so I can look
       at it if needed.  This is all optional.
       Note also that the fsf value (0-6) (skip count) before any restores 
       ends up being the file number recorded in that header file.
NOTE:  it does a rewind and fsf for every file written.   That is
       sort of supersticious behavior left over from some early UNIX
       (not FreeBSD, but a proprietary BSD) systems that didn't handle
       tape marks and positioning very well.   Doing the extra rewinds
       and fsf-s made sure it was in the right place each time and I
       still do it.   DLTs and DATs rewind and fsf very fast anyway.
Oh, I see someone out there will hate me because it uses csh shell.  
Well, so what.  Who cares.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
#!/bin/csh -x

if ((`id -u`) != "0") then
  echo The XXXX backup must be run by root

echo " Beginning XXXX backup at: `date` "
echo " Make sure the tape is in the drive "

### NOTE:  Put something in here to chose a dump level based on date
###        if you need and then plug that in to the dump command.

rm -f /XXXX_tphead
touch /XXXX_tphead
echo " " >> /XXXX_tphead
echo " Index of files for the SERVER XXXX backup tape " >> /XXXX_tphead
echo " " >> /XXXX_tphead
echo " Backup run began at: `date` " >> /XXXX_tphead
echo " " >> /XXXX_tphead
echo " Order of files on tape " >> /XXXX_tphead
echo "   File 0:  This index file " >> /XXXX_tphead
echo "   File 1:  Dump of / " >> /XXXX_tphead
echo "   File 2:  Dump of /home " >> /XXXX_tphead
echo "   File 3:  Dump of /site " >> /XXXX_tphead
echo "   File 4:  Dump of /site/junk " >> /XXXX_tphead
echo "   File 5:  Dump of /site/goodies" >> /XXXX_tphead
echo "   File 6:  Dump of /work " >> /XXXX_tphead

echo " " >> /XXXX_tphead

mt rewind
echo Writing index file to tape
dd conv=sync of=/dev/nrsa0 if=/XXXX_tphead

mt rewind
mt fsf 1
echo Dumping root
/sbin/dump -0af /dev/nrsa0 /

mt rewind
mt fsf 2
echo Dumping home
/sbin/dump -0af /dev/nrsa0 /home

mt rewind
mt fsf 3
echo Dumping /site
/sbin/dump -0af /dev/nrsa0 /site

mt rewind
mt fsf 4
echo Dumping /site/junk
/sbin/dump -0af /dev/nrsa0 /site/junk

mt rewind
mt fsf 5
echo Dumping /site/source
/sbin/dump -0af /dev/nrsa0 /site/goodies

mt rewind
mt fsf 6
echo Dumping work
/sbin/dump -0af /dev/nrsa0 /work

echo Unmounting the tape
mt offline
echo The XXXX backup is done

echo " Backup run ended at: `date` " >> /XXXX_tphead
echo " Ending XXXX backup at: `date` "

More information about the freebsd-questions mailing list