I’m trying to write a batch script under Windows for the option --run-script-after. So far so good it works. I’m reading the env vars fine and act on them. I now need to do something backup job specific. (Pass a special ID to my batch which should NOT be the same as the backup job name)
When I set --run-script-after=c:\temp\test.cmd 123456 ABCDEFG DEFGZ , the batch script no longer gets executed by Duplicati and it tells on the UI it can’t find the batch “c:\temp\test.cmd 123456 ABCDEFG DEFGZ”. Can this be done with the current version or does it represent a feature request? I’d wisch I could store the batch params in every backup job.
You cannot pass parameters to the script like this - it’s not currently supported.
One workaround is to create a wrapper script that calls your main script with the parameter you want. You then call the wrapper script from your backup job. You’d need one wrapper script for each unique parameter of course, so it’s not ideal.
Maybe an option can be added in the future to support script command line parameters.
Thanks for your answer. I’ve taken your suggested approach by using a script to hold the params and this is sourced by the main script I’m executing from the duplicati job.
So no hurry but it would be nice to see the feature in the future some time. I’m totally happy with Duplicati.
I to would love to have parameters possible on run-script.
You can pass a password to your script and have it protected by Duplicati encryption.
If you use password in plain in your scripts, they are vulnerable.
Since this just got treated as a feature request, I changed its category to make it a bit easier to see.
GitHub is a better tracker (but less visible for most users), so I’ll point to that enhancement request: