> Is it possible to run a post schedule command only if the backup was > successful? > > e.g. I want it to backup some files in a directory, then erase the files in > that directory - but only if the backup was successful. If it wasn't, I'd > rather it leave the files there so it can back them up the next time around.
I once got a request somewhat like this. I wrote a script that listed files in the directory involved, converted the list into 'query backup' commands, fed the commands to dmsc, extracted file names from the output of dsmc (the output from 'query backup' does not contain a file name if there is no backup), and erased the named files. The 'query backup' check provides a significantly more convincing proof of successful backup than a zero exit status from dsmc. I was dealing with Oracle redo logs, which always have unique names. If it had been possible for file names to be reused, I would have needed a somewhat more complicated script that checked dates to ensure that the particular instance of the file then on disk had been backed up.
