Run-script-after: Pass command line params to batch script

Hi,

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.

Thank you.

Kind regards
Catfriend1

Version: Duplicati 2.0.5.1 beta

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.

1 Like

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. :slight_smile: I’m totally happy with Duplicati.