Hi, i’m trying to run and script in --run-script-before-required, try various ideas but always return error 255. My last script just has this:
#!/bin/bash
# We read a few variables first.
EVENTNAME=$DUPLICATI__EVENTNAME
OPERATIONNAME=$DUPLICATI__OPERATIONNAME
echo "+++ XS Script v.2 +++"
# Basic setup, we use the same file for both before and after,
# so we need to figure out which event has happened
# if [ "$EVENTNAME" = "BEFORE" ]; then
# if [ "$OPERATIONNAME" = "Backup" ]; then
# docker exec -it nextcloud occ maintenance:mode --on
# codigo_salida=$?
# echo "Mantenimiento. Código de salida: $codigo_salida"
# else
##This will be ignored
# echo "Got operation \"$OPERATIONNAME\", ignoring"
# fi
# elif [ "$EVENTNAME" = "AFTER" ]; then
# if [ "$OPERATIONNAME" = "Backup" ]; then
# docker exec -it nextcloud occ maintenance:mode --off
# else
##This will be ignored
# echo "Got operation \"$OPERATIONNAME\", ignoring"
# fi
# else
# echo "Got unknown event \"$EVENTNAME\", ignoring" 2>&1
# fi
exit 0
duplicati is running on ASUSTOR NAS and has busybox as shell (I think), so trying #!/bin/sh as well…
this is the output:
Input command: backup
Input arguments:
webdavs://...
/volume1/Docker/Nextcloud/config/
Input options:
backup-name: TEST nextcloud
dbpath: ...
encryption-module: aes
compression-module: zip
dblock-size: 50mb
keep-time: 3M
passphrase: ...
run-script-before-required: /volume1/home/userxx/.scripts/duplicati-run-script.sh
run-script-after: /volume1/home/userxx/.scripts/duplicati-run-script.sh
debug-output: true
disable-module: console-password-input
Backup started at 03/06/2025 01:56:02
Error while executing script "/volume1/home/userxx/.scripts/duplicati-run-script.sh": The script "/volume1/home/userxx/.scripts/duplicati-run-script.sh" returned with exit code 255 => Duplicati.Library.Interface.UserInformationException: The script "/volume1/home/userxx/.scripts/duplicati-run-script.sh" returned with exit code 255
at Duplicati.Library.Modules.Builtin.RunScript.Execute (System.String scriptpath, System.String eventname, System.String operationname, System.String& remoteurl, System.String[]& localpath, System.Int32 timeout, System.Boolean requiredScript, System.Collections.Generic.IDictionary`2[TKey,TValue] options, System.String datafile, System.Nullable`1[T] level) [0x001c4] in <0c128520bd854358a4b1ab8a996ba54d>:0
The script "/volume1/home/userxx/.scripts/duplicati-run-script.sh" returned with exit code 255
Duplicati.Library.Interface.UserInformationException: The script "/volume1/home/userxx/.scripts/duplicati-run-script.sh" returned with exit code 255
at Duplicati.Library.Modules.Builtin.RunScript.Execute (System.String scriptpath, System.String eventname, System.String operationname, System.String& remoteurl, System.String[]& localpath, System.Int32 timeout, System.Boolean requiredScript, System.Collections.Generic.IDictionary`2[TKey,TValue] options, System.String datafile, System.Nullable`1[T] level) [0x004fb] in <0c128520bd854358a4b1ab8a996ba54d>:0
at Duplicati.Library.Modules.Builtin.RunScript.OnStart (System.String operationname, System.String& remoteurl, System.String[]& localpath) [0x0000d] in <0c128520bd854358a4b1ab8a996ba54d>:0
at Duplicati.Library.Main.Controller.SetupCommonOptions (Duplicati.Library.Main.ISetCommonOptions result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter) [0x002ec] in <9cab5b8f1b4f49ec980acae8e278968b>:0
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0026f] in <9cab5b8f1b4f49ec980acae8e278968b>:0
at Duplicati.Library.Main.Controller.Backup (System.String[] inputsources, Duplicati.Library.Utility.IFilter filter) [0x00074] in <9cab5b8f1b4f49ec980acae8e278968b>:0
at Duplicati.CommandLine.Commands.Backup (System.IO.TextWriter outwriter, System.Action`1[T] setup, System.Collections.Generic.List`1[T] args, System.Collections.Generic.Dictionary`2[TKey,TValue] options, Duplicati.Library.Utility.IFilter filter) [0x00119] in <81fea8e154eb4fd9aa8b06aac66d311a>:0
at Duplicati.CommandLine.Program.ParseCommandLine (System.IO.TextWriter outwriter, System.Action`1[T] setup, System.Boolean& verboseErrors, System.String[] args) [0x00342] in <81fea8e154eb4fd9aa8b06aac66d311a>:0
at Duplicati.CommandLine.Program.RunCommandLine (System.IO.TextWriter outwriter, System.IO.TextWriter errwriter, System.Action`1[T] setup, System.String[] args) [0x00002] in <81fea8e154eb4fd9aa8b06aac66d311a>:0
Return code: 100
What else can I try?
many thanks…