Use return code on external command to inhibit a profile?
Posted: Wed Jul 31, 2024 11:12 pm
I want to prevent a backup profile from running if Windows signals that a drive failure is imminent (SMART) on the source drive. This would be a measure to both limit drive activity and not copy potentially corrupt files in the event of a decaying drive state.
I have an Windows console app (DriveHealth.exe) that I can call in which the exit code is 0 if all is well, or non-zero (1) if the specified drive is flagged as going bad. It also outputs to the console, but that is a verbose text output that I would have to parse for a boolean go / no-go value.
I figured I could use a pascal script in Syncovery to call this app and catch it's exit code, but I'm not sure if that is possible.
I wrote the little DriveHealth app, so I guess I could add a switch to make the console output a simple TRUE/FALSE if all I can read in Syncovery is the console output.
Any ideas on how I could best implement this?
On a side note, it would be nice if the Execute Command Before feature could have a way to abort the profile run if the command or script returned an error code.
I have an Windows console app (DriveHealth.exe) that I can call in which the exit code is 0 if all is well, or non-zero (1) if the specified drive is flagged as going bad. It also outputs to the console, but that is a verbose text output that I would have to parse for a boolean go / no-go value.
I figured I could use a pascal script in Syncovery to call this app and catch it's exit code, but I'm not sure if that is possible.
I wrote the little DriveHealth app, so I guess I could add a switch to make the console output a simple TRUE/FALSE if all I can read in Syncovery is the console output.
Any ideas on how I could best implement this?
On a side note, it would be nice if the Execute Command Before feature could have a way to abort the profile run if the command or script returned an error code.