PDA

View Full Version : Auto Tar backup help


granade
9th February 2009, 01:04 PM
Hi all!

http://www.faqs.org/docs/securing/chap29sec306.html

I am following this tut and i have hit a snag. Its setup with my server and share info but in step two im totally confused. Im not sure what to put in the TIMEDIR or what it is asking me to do.

I have looked at ps aux and the cron service is running. I also did a crontab -l and i get this:
55 22 * * * /etc/webmin/cron/tempdelete.pl
@weekly /etc/webmin/fsdump/backup.pl 126191233803197

I currently have Webmin to run my backups, is this interfering? Should i remove webmin first?

Could one of you fine folk please clarify this step in noob terms?


COMPUTER=servername
DIRECTORIES=/myshares
BACKUPDIR=/dev/st0
TIMEDIR=/backups/last-full
TAR=/bin/tar


2. If you are not running this backup script from the beginning of the month 01-month-year, the incremental backups will need the time of the Sunday backup to be able to work properly. If you start in the middle of the week, you will need to create the time file in the TIMEDIR. To create the time file in the TIMEDIR directory, use the following command:

[root@deep] /# date +%d%b < /backups/last-full/myserver-full-date

Where /backups/last-full is our variable TIMEDIR wherein we want to store the time of the full backup, and myserver-full-date is the name of our server e.g. deep, and our time file consists of a single line with the present date i.e. 15-Feb.





Thanks

G

granade
10th February 2009, 03:03 PM
I used this script instead.


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

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

DIRECTORIES="/etc /repository/share/Data_Store" # 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

Tacarigua Travel Photos on Instagram - Coin Travel Photos - Pangkalan Brandan Instagram Photos