-   Linux - Software (
-   -   Simple help with a backup script (

GraemeK 05-20-2005 06:12 AM

Simple help with a backup script

I'm running Fedora core 3 on an old SCSI box of mine. I have a SONY 7000 DDS DAT drive in it. Now I have the KDE desktop working and i've managed to use KDAT to backup my /var/spool/mail file. that is my imap mbox file.

I want to leave a tape in the drive and then have a cron job backup /var/spool/mauk/username every day. just incase the mbox file gets corrupt.
I dont want the tape to eject.

I would like to use a simple program like TAR for backup so the backp 'could' be restored on any Linux box regardless of distro.

As i've said above, I know the tape drive is working under the KDAT GUI app so i dont see why it wouldnt work on the CMD with a Cron job?

Whats best to start? and how can i test the script to confirm it works?

Please remind me where the cron jobs go? I think theres a crontab file where you refernce the job and time etc then you stick the script in cron daily?


mjsurette 05-20-2005 11:43 PM

Personally I use star (streaming tar) from It's designed for use with tape drives and gives me dramatically quicker backups.

Here is a short script that should fill your needs. It's a highly stripped down version of what I use. Be sure to check that the directories are right for you.

# a few constants

MT="/opt/schily/bin/mt -f ${Drive}"
OPT="-c -h -v -fifostats f=${Drive}"

echo "=============================================="
echo `$DATE` "start backup"
cd $TarDir
echo `$DATE` "taping complete"

All times are GMT -5. The time now is 09:20 PM.