Direkt zum Inhalt

TIH 2010 pre backup command that fails doesn't fail task

Thread needs solution

TIH build 6053, Win7 64-bit

I've added a .CMD file as a pre-backup command and it gets executed fine. The problem is that the backup task continues even if the command fails.

"Abort the operation if the user command fails" is checked, and in the task log, there is an "Error" entry with the text "Child process has exited with code 'xx'", and 'xx' is the proper exit value. But the next line in the log is "Execution of user command succeeded", and the backup task continues as if nothing had happened.

I had assumed that a pre-command return value other than "0" would abort the backup process. What do I need to do to have my pre-backup command actually cause the backup to *NOT* be performed?

Thanks!

garryj
----------

0 Users found this helpful

I have acronis jobs with pretask scripts. all behave exactly like your understanding.
However all of mine are ".bat" scripts not .cmd this may or may not be material to your issue.
However I do know that these two trival batch scripts behave as you describe one exits success the other failure, the first lets the backup proceed the other does not.

Here is a "good" script example...
:: good.bat
:: a zero code means success
exit 0

:: bad.bat
:: any non-zero code will be considered a failure
exit 99

Furp. Apparently a .cmd file doesn't fall under the category of "user command". Changed the extension to .bat, and now it fails on non-zero exit code.

Whoda thunk...

Thanks, oracledba!