04-03-2012
Yes, the script is executing thru cron as follows:
# Backup /data directories into tape device
#==========================================
0 5 * * * /export/home/provadm/script/tape_backup.sh >/dev/null 2>&1
#
I was unable to find any cron logs from /var/log.
Can you advise me which directory can I look for cron logs?
Thanks
---------- Post updated at 12:15 PM ---------- Previous update was at 12:05 PM ----------
Quote:
Originally Posted by
hicksd8
Are you saying that this used to work? Or have your backups just got bigger over time and now tape is filling up?
What backup utility is being used? tar, cpio, ufsdump, or what?
Some utilities require you to tell it how big the tape is on the command line.
Yes, this used to be working fine a year ago.
I've tested filling up a tape with some dummy files which i created in the directory, till it reaches the capacity of the tape(72GB). However, there is no alarm triggered.
I use tar as the backup utility.
---------- Post updated at 12:43 PM ---------- Previous update was at 12:15 PM ----------
Below is the shell script which was created by the previous engineer:
#!/bin/sh
#set -x
VERSION="Version: 1.06"
######################
# Choose the HOME dir
#####################
#HOME=/export/home/oracle
HOME=/export/home/provadm
BINDIR=$HOME/bin
LOGDIR=$HOME/log
SCRDIR=$HOME/script
CONFDIR=$HOME/config
TEMP=$HOME/temp
#CONFIG_FILE="$CONFDIR/logInfo.cfg"
#######################
# Choose the BACKUP dir
#######################
#LSMS dir is /data1
BACKUPDIR=/data
#PGW,RPT,LNPDB dir is /data
#BACKUPDIR=/data
#BACKUPDIR2=/data/data1
#LOGS=`cat $CONFIG_FILE | grep -v ";" | /bin/awk '{print $2}'`
#LOGS=`echo $LOGS`
newhost=`hostname |sed 's/LIV_//'| sed 's/_01//'`
TAPE_DEVICE=/dev/rmt/0
TAPE_DEVICE_APPEND=/dev/rmt/0n
datestr=`date +%d-%m-%Y`
timestr=`date +%H:%M:%S`
event_day=`/bin/date +%Y%m%d`
currdate=`$HOME/bin/lastdate +1 | awk '{printf "%s",substr($0,1,6)}'`
LOG=$LOGDIR/TAPE/$currdate/tape_bk_$event_day.log
TMP_LOG=$TEMP/tape_backup.tmp
# Format yyyymmdd
yest01=`$BINDIR/lastdate 1 | /bin/awk '{print $1}'`
# Format MMM
mm=`$BINDIR/lastdate 1 | /bin/awk '{print $2}' | cut -c1-3`
# Format DD
dd=`$BINDIR/lastdate 1 | /bin/awk '{print $1}' | cut -c7-8`
# Format YYYY
yyyy=`$BINDIR/lastdate 1 | /bin/awk '{print $1}' | cut -c1-4`
# Format yyyymm
yestmonth01=`$BINDIR/lastdate 1 | /bin/awk '{print $1}' | cut -c1-6`
# ==============
# Date and Month
# ==============
REP_MONTH=`date "+%Y%m"`
REP_DATE=`date "+%Y%m%d"`
FIRST_DAY=`$BINDIR/lastdate | /bin/awk '{print $1}' | cut -c7-8`
chktape()
{
status=`/bin/mt -f $TAPE_DEVICE_APPEND status | grep 'sense' | awk '{print substr($1,1,5)}'`
}
tarcmd()
{
# Check the $TMP_LOG file if exists, if yes remove the file
if [ -f $TMP_LOG ]; then
rm $TMP_LOG
fi
#/data1/ACCESS
#All Servers
/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/ACCESS/$yestmonth01/*$yest01*.tar.Z >> $LOG 2>>$TMP_LOG
if [ $FIRST_DAY = "01" ]; then
#/data1/BACKUP
# All Servers
/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/BACKUP/$yestmonth01/*_$yestmonth01.* >> $LOG 2>>$TMP_LOG
fi
#/data/BACKUP
# LNPDB, RPT
#/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/BACKUP/$yestmonth01/*$yest01*.tar.gz >> $LOG 2>>$TMP_LOG
#/data1/SYS
# All Servers
/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/SYS/$yestmonth01/$yest01*.Z >> $LOG 2>>$TMP_LOG
#/data1/TDR1
# LSMS, RPT
#/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/TDR1/$yestmonth01/$yest01*.Z >> $LOG 2>>$TMP_LOG
#/data1/TDR1_M
# LSMS
#/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/TDR1_M/$yestmonth01/$yest01*.TDR1_M.Z >> $LOG 2>>$TMP_LOG
#/data/TDR2
# PGW, RPT
/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/TDR2/$yestmonth01/$yest01*.*.TDR2.Z >> $LOG 2>>$TMP_LOG
# /data/TDR2_M
# PGW
/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/TDR2_M/$yestmonth01/$yest01*.TDR2_M.Z >> $LOG 2>>$TMP_LOG
# /data/IPMP
# LSMS, PGW, LNPDB, RPT
/bin/tar cvf $TAPE_DEVICE_APPEND $BACKUPDIR/IPMP/$yestmonth01/IPMP.log.$yest01.*.Z >> $LOG 2>>$TMP_LOG
}
# Main
status=""
chktape
if [ "$status" = "sense" ]
then
# Got tape inside
# Clear alarm
$SCRDIR/gen_alarm.sh 21 0 "$newhost No Tape detected"
# Start doing backup
echo "" | /bin/tee -a $LOG
echo "Tape Backup Start ($datestr $timestr) ..." | /bin/tee -a $LOG
echo "" | /bin/tee -a $LOG
#echo "Logs folder: [$LOGS]"
#for logfolder in $LOGS
#do
tarcmd >> $LOG
#done
if [ $? -ne 0 ]
then
# Put the stderr message generated from tarcmd() into the $LOG file
cat $TMP_LOG >> $LOG
echo "" | /bin/tee -a $LOG
echo "Tape Backup was failed" >> $LOG
#cd $BINDIR
$SCRDIR/gen_alarm.sh 23 1 "$newhost Tape backup error"
else
# Put the stderr message generated from tarcmd() into the $LOG file
cat $TMP_LOG >> $LOG
echo "" | /bin/tee -a $LOG
echo "Tape Backup Succeeded" >> $LOG
#cd $BINDIR
$SCRDIR/gen_alarm.sh 23 0 "$newhost Tape backup error"
fi
EOT=`cat $TMP_LOG | grep 'tar: write error: unexpected EOF' | wc -l`
if [ $EOT -ge 1 ]; then
# Tape Full
# Raise alarm
$SCRDIR/gen_alarm.sh 22 1 "$newhost Tape full"
echo "" | /bin/tee -a $LOG
echo "Tape Full ($datestr $timestr) ..." | /bin/tee -a $LOG
echo "" | /bin/tee -a $LOG
else
# Tape NOT Full
# Clear alarm
$SCRDIR/gen_alarm.sh 22 0 "$newhost Tape full"
fi
echo "" | /bin/tee -a $LOG
datestr=`date +%d-%m-%Y`
timestr=`date +%H:%M:%S`
echo "Tape Backup End ($datestr $timestr) ..." | /bin/tee -a $LOG
else
# No tape inside
# Raise alarm
$SCRDIR/gen_alarm.sh 21 1 "$newhost No Tape detected"
echo "" | /bin/tee -a $LOG
echo "Tape Backup Fail ($datestr $timestr) ..., unable to find tape" | /bin/tee -a $LOG
echo "" | /bin/tee -a $LOG
fi
# Housekeep the tape_bk_yyyymmdd.log
hk_month=`$BINDIR/lastdate 121 | /bin/awk '{print $1}' | /bin/cut -c1-6`
\rm $LOGDIR/TAPE/$currdate/tape_bk_$hk_month*.log
find $TEMP -name 'tape_backup.tmp' -exec rm {} \;
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi there: I'm new here
Can anyone help me:
I have DS15 Alpha server : Unix 5.1B
Now i need to connect a DLVT VS80 1U Rackmount Tape Drive unit.
What is the exact comman to mount the DLTape IV??
How do i make backuo @ copy file to the tape?
Thanx to all (0 Replies)
Discussion started by: ayzeayem
0 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I performed backup on tape and I want to append more files to my previous backup on the same backup tape. But before I do that I need to know the backup file size of the first backup I performed so that I know the available size on the backup tape. Can someone help me what command I will use... (0 Replies)
Discussion started by: ayhanne
0 Replies
3. SCO
I am trying to make a full backup of my system using the cpio command. The Tape Unit is a SCSI DDS.
The process started fine but after about 30 minutes, it just stopped and showed the following message:
1755 Signal 31 - Core dumped
Any idea of what is causing this and how to fix it?
... (4 Replies)
Discussion started by: zionpc
4 Replies
4. UNIX for Dummies Questions & Answers
hi,
Recently, I had receive one system. it's run on the unix tru64 server.
I looking some log files when i know don't work few months age system backup to tape.
Below error:
INFO:Tape backups to tape tape0 starting
for backup list:
slot2:/disk4
Backup Command Variable... (0 Replies)
Discussion started by: Tlg13team
0 Replies
5. Solaris
Dear All ;
first how are you every body I'm just subscribed in your forum and i hope i found what i searched for along time .
I'm not a Solaris specialist but i read more to build a Network Management Station depends on Solaris as OS and it is working good now .
my problem is how to perform... (16 Replies)
Discussion started by: Basha
16 Replies
6. Solaris
I have unix server with OS 5.8 ,,,
I tried ufsdump 0ua -f /dev/rmt/0 / to perform full system backup on tape but I failed could any one give a procedure for full system backup on solaris machine using tapes??? (1 Reply)
Discussion started by: mm00123
1 Replies
7. Red Hat
Hi,
our redhat farm is growing (rhel 3 4 5) and the only backup we do is an incremental filesystembackup, which makes it very hard to restore the complete os
is there a solution for a complete os-backup to a network server, like nim in aix,
an the possibility to restore the whole red hat... (1 Reply)
Discussion started by: funksen
1 Replies
8. UNIX for Dummies Questions & Answers
Hi, i'm new here(and a newbie) and i need some help with a project. I need to write a script for an incremental backup (this must be executed every day at 24:00) and a full backup (executed once a month) for etc/var/home directories. Can someone please help me with this? And a small explanation of... (9 Replies)
Discussion started by: bender-alex
9 Replies
9. Homework & Coursework Questions
Hi. Can someone tell me if the following script that i have made is a script for INCREMENTAL BACKUP or FULL BACKUP. My teacher told me that is doing an FULL BACKUP.
• find /etc /var /home -newer /backups/.backup_reference > /backups/.files_to_archive
• touch /backups/.backup_reference
• tar... (1 Reply)
Discussion started by: bender-alex
1 Replies
10. AIX
I have a NIMOL(nim on linux) server working. It do a full backup of my rootvg with those commands
nimol_config -r -L old-2018
nimol_config -m /usr/bin/ssh -C -L new-2018
nimol_backup -c ibmaix -L new-2018
My question is: is possible like hp-ux do with "make_tape_recovery" a FULL... (1 Reply)
Discussion started by: Linusolaradm1
1 Replies