probkup question about error checking

tonedeaf

New Member
I am running Progress 10.1C on a linux server. I am attempting to script an autobackup script.

my script does work but it has no error checking. I want to put an exception for error checking. Does probkup give any error message if it fails a backup. I would like it to email me if it fails. can someone help? Here is a part of my script. if i can find a way to parse the backuplog file for an error message and then trigger a SMTP procedure it would be great. I dont know how to recognize the logic in the script. maybe an 'if' statement?

Code:
probkup online <DBDIR>/<DBNAME> <BACKUPDIR>/<BACKDB> -com >>  <BACKUPLOG>
 
if you add " 2> <ERRORLOG> to the end of your command line you will get a separate error log. In unix > is to direct output that would be on screen to a file >> is to direct output that would be on screen to a file but to append to an existing file 2> means "direct error output" and 2>> means "direct error output" but append to the file

You could then just email the error log to yourself
 
Thanks for your response. Here is my output on my log file. Best case would be if there was an error I would be emailed saying there was an error. I do understand your point. I could have it email me a message everyday. I just have never seen a "backup error" before on a backup before as thsi is the first time i have worked with Progress. Thanks for the tips on ">" ">>" i totally forgot about the nuances between both.

There is no server for database /usr/wrk/db01. (1423)

25313 active blocks out of 25359 blocks in /usr/testdb/testdb will be dumped. (6686)
3456 BI blocks will be dumped. (6688)
Backup requires an estimated 126.1 MBytes of media. (9285)
Restore would require an estimated 32285 db blocks using 31.5K of media. (9286)
Backed up 28769 db blocks in 00:00:10
Wrote a total of 701 backup blocks using 93.1 MBytes of media. (13625)

Backup complete. (3740)


24780 active blocks out of 24783 blocks in /usr/tempdb00/tempdb will be dumped. (6686)
256 BI blocks will be dumped. (6688)
Backup requires an estimated 99.0 MBytes of media. (9285)
Restore would require an estimated 25345 db blocks using 24.7K of media. (9286)
Backed up 25036 db blocks in 00:00:15
Wrote a total of 501 backup blocks using 66.5 MBytes of media. (13625)

Backup complete. (3740)
 
This will help you.

probkup online <DBDIR>/<DBNAME> <BACKUPDIR>/<BACKDB> -com >> <BACKUPLOG>
ERR=$?
if [ "$ERR" != "0" ]
then
echo "Backup Err"|mailx -s "Backup Error" -a <logfile> <ur-mailid>
fi
 
Back
Top