Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup Status Report

Status
Not open for further replies.

johngiggs

Technical User
Oct 30, 2002
492
US
I am trying to have a backup status report generated daily and mailed to myself. I am running NetBackup 3.4 for UNIX. I know how to create the report with the GUI, but I would like to execute the command from the command line and output it to a file and mail it. Is this possible? If so, can someone please explain to me how to go about doing so?

Thanks,

John
 
Here is what I am using:

#!/bin/ksh


#################################################################
#
# Variable definitions
OUTTEMP=d:/veritas/backupresults/temp.txt
OUTF=d:/veritas/backupresults/dailyreport.txt
SR=//<our_report_server>/reports/veritas/hdailydetailed.txt
SUMMARY=//,our_report_server>/reports/veritas/hdailysummary.txt
RES=d:/veritas/backupresults
ADMIN=d:/veritas/netbackup/bin/admincmd

#################################################################
#
# Initialize Log File

if [ -f $OUTF ];then
rm $OUTF
fi

#################################################################
#
# Main Body of Script
$ADMIN/bpdbjobs -report -all_columns > $SS
$ADMIN/bpdbjobs -report -all_columns > $SR
cp c:/srvapps/ActiveBatch/Scripts/printheader.txt $OUTF
echo &quot;BACKUP JOB SUMMARY for `date`&quot; >> $OUTF
echo &quot;================================================== &quot; >> $OUTF
echo &quot; &quot; >> $OUTF
$ADMIN/bpdbjobs -summary -L >> $OUTF
$ADMIN/bpdbjobs -summary > $SUMMARY
echo &quot; &quot; >> $OUTF
echo &quot;BACKUP JOB STATUS for `date`&quot; >> $OUTF
echo &quot;================================================== &quot; >> $OUTF
echo &quot; &quot; >> $OUTF
$ADMIN/bpdbjobs.exe -report > $OUTTEMP
cat $OUTTEMP | sort -r -k 4,5 >> $OUTF
echo &quot; &quot; >> $OUTF


This is called by a batch file that has other commands in it to get additional information:

call d:\veritas\scriptfiles\get_failed_files.cmd
echo %date% > d:\veritas\backupresults\CleaningTapes.txt
echo. >> d:\veritas\backupresults\CleaningTapes.txt
vmquery -mt dlt_clean -b >> d:\veritas\backupresults\CleaningTapes.txt
echo. >> d:\veritas\backupresults\CleaningTapes.txt
vmquery -mt hcart_clean -b >> d:\veritas\backupresults\CleaningTapes.txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top