Can't get --run-script-after to work

I’m using ZFS to make snapshots of the destination after a backup completes. Unfortunately, I’m getting errors when I use --run-script-after. (More specifically, I’m using the GUI interface and added it as an extra option in step 5.) When I try to run a command directly, I get this:

2021-09-05 14:17:42 -06 - [Warning-Duplicati.Library.Main.Controller-OptionValidationError]:
The value "/usr/sbin/zfs snapshot tank/duplicati/brad-computer@`date +"%b-%d-%y_%H:%M:%S"`" 
supplied to --run-script-after does not represent a valid path

When I changed to execute that in a script instead, I get:

Warning while running Brad Computer -> Dest Storage
2021-09-05 14:25:11 -06 - [Warning-Duplicati.Library.Modules.Builtin.RunScript-ScriptExecuteError]:
Error while executing script "/external/scripts/bradbackup_brad-computer.sh":
The system cannot find the file specified

For both, I verified each command works by copying the command from the error message, pasting it in an ssh terminal command prompt, pasting it, and verifying it functions correctly.

I’m at a loss what to try next. Is there anything special I need to do to make --run-script-after work?

You definitely need to use a script. This option in Duplicati doesn’t allow command plus parameters.

As far as why the script isn’t working, can you check to make sure you have a script processor in the first line of your script? For example:

#!/bin/bash

It’s already in there and the script runs just fine:

bradbackup@ubuntu:~$ cat /external/scripts/bradbackup_brad-computer.sh
#!/bin/bash
/usr/sbin/zfs snapshot tank/duplicati/brad-computer@`date +"%b-%d-%y_%H:%M:%S"`
bradbackup@ubuntu:~$ zfs list -t snapshot
NAME                                              USED  AVAIL     REFER  MOUNTPOINT
tank/duplicati/brad-computer@Sep-05-21_20:39:18     0B      -     36.2G  -
bradbackup@ubuntu:~$ /external/scripts/bradbackup_brad-computer.sh
bradbackup@ubuntu:~$ zfs list -t snapshot
NAME                                              USED  AVAIL     REFER  MOUNTPOINT
tank/duplicati/brad-computer@Sep-05-21_20:39:18     0B      -     36.2G  -
tank/duplicati/brad-computer@Sep-05-21_23:20:44     0B      -     36.2G  -

Ok thanks for confirming…it’s one reason I’ve seen scripts fail to run.

Duplicati is running directly on this system where the script resides? Not in some other system or layer (like a docker container)?

Oh. I think I’ve got it.

I think --run-script-after executes a script from the client side. I spent all day configuring zfs on the server, and I’ve already given Duplicati an ssh username and password to do its work. So my brain never thought twice when it just assumed the script runs server side.

Edit: Yes, drwts32 was on it at the same time I was writing mine.

Now I need to figure out a way to execute a server side script on Duplicati job completion…

Hah, glad you figured it out. Yes Duplicati runs everything locally. Shouldn’t be too hard to have a local script run remote commands though, especially if both sides are Linux.