Hokay, I'm stuck.  I give.  I need help.

The documentation for UserCmdCheckStatus says:

"Whether the exit status of each PreUserCmd and PostUserCmd is checked.

"If set and the Dump/Restore/Archive Pre/Post UserCmd returns a non-zero exit status then the dump/restore/archive is aborted. To maintain backward compatibility (where the exit status in early versions was always ignored), this flag defaults to 0.

"If this flag is set and the Dump/Restore/Archive PreUserCmd fails then the matching Dump/Restore/Archive PostUserCmd is not executed. If DumpPreShareCmd returns a non-exit status, then DumpPostShareCmd is not executed, but the DumpPostUserCmd is still run (since DumpPreUserCmd must have previously succeeded).

"An example of a DumpPreUserCmd that might fail is a script that snapshots or dumps a database which fails because of some database error."


Simple enough - so I wrote a script to verify that the location to which I am about to try to backup actually exists (I'm backing up to a removable drive that does get removed, from time to time, and I only want the backups to run when the drive is attached). Then I set this script to the value for the various Pre conditions:

$Conf{DumpPreUserCmd} = '$sshPath -q -x -l kimball $host /usr/local/ bin/checkHonker';
$Conf{DumpPostUserCmd} = undef;
$Conf{DumpPreShareCmd} = '$sshPath -q -x -l kimball $host /usr/local/ bin/checkHonker';
$Conf{DumpPostShareCmd} = undef;
$Conf{RestorePreUserCmd} = '$sshPath -q -x -l kimball $host /usr/ local/bin/checkHonker';
$Conf{RestorePostUserCmd} = undef;
$Conf{ArchivePreUserCmd} = '$sshPath -q -x -l kimball $host /usr/ local/bin/checkHonker';
$Conf{ArchivePostUserCmd} = undef;

and I set it to check the status of the user commands:

$Conf{UserCmdCheckStatus} = 1;

But it still runs the backup (and writes over my mount point for my external drive)

I've verified that the script returns a non-zero when the drive is not present:

sillyHost:~ backuppc$ /usr/bin/ssh -q -x -l kimball 192.168.0.21 /usr/ local/bin/checkHonker
Checking for Honker
Honker NOT mounted
sillyHost:~ backuppc $ echo $?
1


What am I missing?

-- Kimball

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to