PDA

View Full Version : Running amverify after amdump



vdh
January 18th, 2007, 01:05 AM
I've set up my daily backup to run amverify after amdump has finished by using

amdump daily && amverify daily
To speed up switching the tape, I've added

mt -f /dev/nst0 offline
to the end of my backup script, so the tape is ejected after the backup is run.

When amdump finishes correctly, this works as intended. A problem occurs if amverify fails (e.g. the operator forgot to switch tapes). In this case, amdump also exits with error level 0, causing amverify to run. As there is no tape in the drive, amdump now waits until a tape is put it instead of failing directly. When the operator now puts in a tape, amverify verifies this tape, causing a call to amflush to fail while the verify is running.

Is there any way to either
- set up amdump to exit with a non-zero value if it fails or
- have amverify exit immediately if no tape is in the drive?
Or is there a better way to have a verify run after the backup is completed?