LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-20-2005, 06:12 AM   #1
GraemeK
Member
 
Registered: Aug 2003
Location: Essex, UK
Distribution: Windoze 2000, Fedora Core 3
Posts: 325

Rep: Reputation: 30
Simple help with a backup script


Hiya,

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?

thanks.
 
Old 05-20-2005, 11:43 PM   #2
mjsurette
Member
 
Registered: May 2005
Distribution: aptosid
Posts: 55

Rep: Reputation: 18
Personally I use star (streaming tar) from http://cdrecord.berlios.de/old/private/star.html 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.

#!/bin/bash
# a few constants

TarDir="/var/spool/mail"
Drive="/dev/st0"
MT="/opt/schily/bin/mt -f ${Drive}"
STAR="/opt/schily/bin/star"
OPT="-c -h -v -fifostats f=${Drive}"
DATE="/usr/bin/date"

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Simple backup system Azhrarn Linux - Software 1 09-16-2005 02:24 PM
simple-backup-script ahmed4linux Linux - General 1 05-04-2005 07:10 PM
simple backup script needed ferret_dude Programming 4 05-24-2004 08:45 AM
Simple way to backup my laptop enine Linux - General 2 02-04-2004 01:00 PM


All times are GMT -5. The time now is 11:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration