Quantcast
Channel: CobianSoft
Viewing all articles
Browse latest Browse all 4265

Cobian Backup 11 (Gravity) • Pre/Post Backup Events: Program exit status ignored

$
0
0
Hello,

I just started using Cobian Backup 11 on Windows 10.

Great program, I like it :APP

What I've noticed when setting up events for a task:

I have the 'cancel the task if some event fails' option ticked and I wanted to have a pre-backup event call & wait:

COMMANDLINE,"powershell ""[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');$ret=[System.Windows.Forms.Messagebox]::Show('Should backup start now?', 'Windowtitle', [System.Windows.Forms.MessageBoxButtons]::OKCancel);exit $ret-1""",true

The script shows a dialog box asking if the backup should start plus an OK and Cancel button.
In the case of Ok the program returns exit code 0, in case of Cancel exit code 1.

The problem is that Cobian Backup doesn't use the return code of the program to check if the script "failed".

I think this is a highly unusual behavior as there is no reason not to use the return code when waiting for the termination of the script.

I would thus like to suggest to include checking the exit status of a program/script when waiting for its termination and using it to cancel the task in future versions.

Thanks,
pandergast

Statistics: Posted by pandergast — 28 Jan 2022, 17:19



Viewing all articles
Browse latest Browse all 4265

Trending Articles