Duplicati Service : Run-Script-After

Hi forum,

That’s my first post on this forum.

Sorry for my english.

We use Duplicati to backup 150 servers Windows on S3, i have made a script to deploy Duplicati, make them run as a service with a specific account, the backup work realy well.

But now we need to monitor all the job we made, i have found some Grafana Dash that are realy cool, but we use Zabbix to monitor all our equipement so i want to use it to check the backup, and keep the grafana to see more detail if somethings goes wrong.

For now i just want to run a script at the end of the job to write in a txt file if everything is good.
my trouble is that my script doesn’t run at the end of my job,

I use the arg --run-script-after = c:\path\to\my\script.bat

i put all the privilege to the account used to run Duplicati as a service and my planned task.

the script do very simple things :

echo %date% %time% >> result.txt

I have give privilege to my account and the txt file.

if i run this script manualy with the same account, it works, if i run my planned task with the backup, the backup work well, the report as been send to my grafana but nothing append to my script.

i have no log in the event viewer, so i don’t know what happen.

the script is localy on the server, everythings is execute localy (Duplicati, job, script, txt file).

if someone have an idea .

This is the command line for the backup without critical info :wink:

backup “s3s://*************” “SOURCE” --backup-name=NAME --dbpath=“C:\MY\DATA.sqlite” --encryption-module=aes --compression-module=zip --blocksize=1MB --dblock-size=200mb --keep-time=3M --passphrase=“MDP” --zip-compression-method=Deflate --zip-compression-level=1 --run-script-after=C:\path\to\my\script.bat --send-http-result-output-format=Json --send-http-url=http://MY-GRAFANA --restore-permissions=true --exclude-files-attributes=“system,hidden” --disable-module=console-password-input

Thank’s

Hi @fndz, thanks for the question.

The variables %date% and %time% are not defined by Duplicati, so they would have to be provided by the environment. I have not tested it, but a guess could be that these are not set in the execution environment used by Duplicati.

Another potential issue could be the location of the file, as the working directory is not set.

Could you try a script like:

echo "Script called" >> C:\known\full\path\result.txt

Just to see that it actually gets invoked?

With the latest canary builds you can also emit warnings and other messages to the log, so you can rule out permission issues.

Thanks @kenkendk ,

da**… the issue is from the location of the result file …

i try your version and everything works well, i put back my variable %date% %time% and keep the full file location and it’s work well to,

I have try to find something more complicated …

Thanks to remind me of always ask myself “Waht’s the main problem ?”

Have a great day.