I recently took over a sys admin position and found that our backup program has not worked in a long time. Our tapes go back a month and they're all bad.
The main issue is that it calls for a second tape, but since it runs at 2 in the morning, no one is here to change it. It times out & sends an error message. In the directory that we are backing up, there are numerous files that can be skipped, but as I'm reverse engineering to see how this thing runs, my attempts at doing so have proven fruitless.
We are running AIX 3.1 on an (old) IBM6000. Here is the script, written eons ago...
# !/bin/sh
#
# Daily backup script by XXXXXXXX
# 21-January-1999
# Modified 12-December-2000
# temporarily backs up only /rims/site1/prod1
# Add other directories to not backup in this script to the following line.
# Separate directory names with a "|".
export IGNOREDIRS="/rims/site1/p1spl|/rims/site1/temp"
# Start of backup directory tree.
export STARTDIR=/rims/site1/prod1
# Device to write backup to:
export BACKDEVICE=/dev/rmt0
# Temporary output file for daily backup...
export OUTFILE=/backup/`/usr/bin/date +"output.%d"`
# Build daily log file headers.
/usr/bin/rm $OUTFILE
echo Backup script started at: `/usr/bin/date` >> $OUTFILE
cd /
# Test the status of the tape.
/usr/bin/mt -f $BACKDEVICE rewind
export TAPE_ERR=$?
# Abort if there is a tape drive error.
if [ "$TAPE_ERR" != "0" ] ; then
echo "!!!!!!!!!!!!!!!!!!!!" >> $OUTFILE
echo " TAPE DRIVE ERROR in script $0! Check tape drive!" >> $OUTFILE
echo "!!!!!!!!!!!!!!!!!!!!" >> $OUTFILE
/usr/bin/mail -s "Tape error on `/usr/bin/date` ($TAPE_ERR)." root < $OUTFILE
exit
fi
echo Tape ready, starting backup at: `/usr/bin/date` >> $OUTFILE
# Make the list of files to backup (find .$STARTDIR -print )
# remove specific directories (grep -vE $IGNOREDIRS)
# and do the backup (backup -iqpvf $BACKDEVICE)
find .$STARTDIR -depth -print | grep -vE $IGNOREDIRS | /usr/sbin/backup -iqpvf $
BACKDEVICE >> $OUTFILE 2>&1
export TAR_ERR=$?
echo Backup finished at: `/usr/bin/date` >> $OUTFILE
if [ "$TAR_ERR" != "0" ] ; then
echo "********************" >> $OUTFILE
echo " ERRORS ENCOUNTERED in script $0! Check previous output!" >> $OUTFI
LE
echo "********************" >> $OUTFILE
/usr/bin/mail -s "Backup error on `/usr/bin/date` ($TAR_ERR)." root < $OUTFILE
fi
# Rewind and eject the tape.
/usr/bin/mt -f $BACKDEVICE rewoffl >> $OUTFILE 2>&1
echo "Completely done, rewound and ejected (`/usr/bin/date`)." >> $OUTFILE
The main issue is that it calls for a second tape, but since it runs at 2 in the morning, no one is here to change it. It times out & sends an error message. In the directory that we are backing up, there are numerous files that can be skipped, but as I'm reverse engineering to see how this thing runs, my attempts at doing so have proven fruitless.
We are running AIX 3.1 on an (old) IBM6000. Here is the script, written eons ago...
# !/bin/sh
#
# Daily backup script by XXXXXXXX
# 21-January-1999
# Modified 12-December-2000
# temporarily backs up only /rims/site1/prod1
# Add other directories to not backup in this script to the following line.
# Separate directory names with a "|".
export IGNOREDIRS="/rims/site1/p1spl|/rims/site1/temp"
# Start of backup directory tree.
export STARTDIR=/rims/site1/prod1
# Device to write backup to:
export BACKDEVICE=/dev/rmt0
# Temporary output file for daily backup...
export OUTFILE=/backup/`/usr/bin/date +"output.%d"`
# Build daily log file headers.
/usr/bin/rm $OUTFILE
echo Backup script started at: `/usr/bin/date` >> $OUTFILE
cd /
# Test the status of the tape.
/usr/bin/mt -f $BACKDEVICE rewind
export TAPE_ERR=$?
# Abort if there is a tape drive error.
if [ "$TAPE_ERR" != "0" ] ; then
echo "!!!!!!!!!!!!!!!!!!!!" >> $OUTFILE
echo " TAPE DRIVE ERROR in script $0! Check tape drive!" >> $OUTFILE
echo "!!!!!!!!!!!!!!!!!!!!" >> $OUTFILE
/usr/bin/mail -s "Tape error on `/usr/bin/date` ($TAPE_ERR)." root < $OUTFILE
exit
fi
echo Tape ready, starting backup at: `/usr/bin/date` >> $OUTFILE
# Make the list of files to backup (find .$STARTDIR -print )
# remove specific directories (grep -vE $IGNOREDIRS)
# and do the backup (backup -iqpvf $BACKDEVICE)
find .$STARTDIR -depth -print | grep -vE $IGNOREDIRS | /usr/sbin/backup -iqpvf $
BACKDEVICE >> $OUTFILE 2>&1
export TAR_ERR=$?
echo Backup finished at: `/usr/bin/date` >> $OUTFILE
if [ "$TAR_ERR" != "0" ] ; then
echo "********************" >> $OUTFILE
echo " ERRORS ENCOUNTERED in script $0! Check previous output!" >> $OUTFI
LE
echo "********************" >> $OUTFILE
/usr/bin/mail -s "Backup error on `/usr/bin/date` ($TAR_ERR)." root < $OUTFILE
fi
# Rewind and eject the tape.
/usr/bin/mt -f $BACKDEVICE rewoffl >> $OUTFILE 2>&1
echo "Completely done, rewound and ejected (`/usr/bin/date`)." >> $OUTFILE