Mysql backup using Duplicati

I don’t and I also don’t script much…

Duplicati handles script exit codes as below. File is also in Duplicati installation folder.
Your script is responsible for knowing what it’s running, and taking appropriate action.

Information on how script output can cause things such as the warning that you saw is covered in:

Where does script output go to (difference between BEFORE and AFTER?)

Output from run scripts

Beyond that, I’m not clear on what’s wanted. Case 2 wants a report. Case 1 gives it, but something elsewhere isn’t as desired. You might need to try some different things until it’s the way you want…

Case 1 will let you avoid the empty backup (if that’s what’s wanted) by setting the script’s exit code.

I did verify that I could throw my own messages into the log by writing to stderr, e.g. echo foo >&2

Improvements for –run-script-before/after options was the feature request. The code work is below:

Added support for multiple exit codes, and added a unittest to verify that the exit codes are handled correctly

Having been spoiled by the Linux date command and its format string, Windows appears a mess…
Format date and time in a Windows batch script has examples of people trying to work around that.