LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-16-2004, 10:17 AM   #1
GraemeK
Member
 
Registered: Aug 2003
Location: Essex, UK
Distribution: Windoze 2000, Fedora Core 3
Posts: 325

Rep: Reputation: 30
Basic backup script using Tar


Hiya,

I've obtained a SCSI Sony DDS2 DAT drive which i'd like to use for regular backups of configs and a small database.

I've found this script which should backup the directories i specify but the drive within the script is a DLT?

Any one know what needs to be changed for my DAT drive? i.e compression and density?


#!/bin/sh
# full and incremental backup script
# created 07 February 2000
# Based on a script by Daniel O'Callaghan <danny@freebsd.org>
# and modified by Gerhard Mourani <gmourani@videotron.ca <mailto:gmourani@videotron.ca>>
# modified for tape use by Chad Amberg <http://www.bluestream.org>

#Change the 3 variables below to fit your computer/backup

DIRECTORIES="/etc /home /opt /root /var" # directories to backup
BACKUPTO=/dev/st0 # where to store the backups
TAR=/bin/tar # name and locaction of tar

#You should not have to change anything below here

PATH=/usr/local/bin:/usr/bin:/bin
START=`date +%s`

# Daily full backup
NEWER=""
echo "***** start time"
date
echo
if mt -f /$BACKUPTO status | grep "ONLINE"; then
echo "***** finding sockets"
find $DIRECTORIES -type s > sockets
echo
echo "***** setting compression on"
mt -f /$BACKUPTO compression 1
echo
echo "***** setting type to DLT 35 Compressed"
mt -f /$BACKUPTO setdensity 0x85
echo
echo "***** archiving"
$TAR $NEWER -cf $BACKUPTO $DIRECTORIES --exclude-from=sockets --absolute-names --totals # --exclude-from=tbackup.ignore
echo
echo "***** tape-drive status"
mt -f /$BACKUPTO status
echo
echo "***** ejecting tape"
mt -f /$BACKUPTO offline
echo
echo "***** end time"
date
else
echo "***** WARNING TAPE DRIVE IS OFFLINE, NO BACKUPS PERFORMED"
fi
FINISH=`date +%s`
diff=$((FINISH - START))
echo -n "***** Total Run Time: "
HRS=`expr $diff / 3600`
MIN=`expr $diff % 3600 / 60`
SEC=`expr $diff % 3600 % 60`
if [ $HRS -gt 0 ]
then
echo -n "$HRS hrs. "
fi
if [ $MIN -gt 0 ]
then
echo -n "$MIN mins. "
fi
if [ $SEC -gt 0 ]
then
if [ $MIN -gt 0 ]
then
echo "and $SEC secs."
elif [ $HRS -gt 0 ]
then
echo "and $SEC secs."
else
echo "$SEC secs."
fi
fi
 
Old 09-17-2004, 05:19 AM   #2
GraemeK
Member
 
Registered: Aug 2003
Location: Essex, UK
Distribution: Windoze 2000, Fedora Core 3
Posts: 325

Original Poster
Rep: Reputation: 30
no one has a DDS2 DAt drive setup within Linux?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic file management / installing .tar.gz SPACE_OG Linux - Newbie 11 10-13-2005 05:35 PM
Bash backup script failing using tar and --newer option saldkj Programming 3 03-12-2005 12:03 PM
Tar backup TheRealDeal Linux - General 7 02-08-2005 03:25 PM
Incremental backup script - Tar problem joshheald Linux - Software 1 09-28-2004 10:02 AM
Backup script to tar untoldone Programming 2 05-20-2004 03:03 PM


All times are GMT -5. The time now is 03:18 AM.

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