Hi, I am using “run-script-after” - but the script is also running, when I abort backup, which I often do. I don’t want to run the script in such a case. Is there some kind of error levels or environment variables which I can use?
In a general sense, all the Duplicati options are exposed as environment variables prefixed with “DUPLICATI__” and, due to some some env. variables not allowing dahes, all dashes (-) replaced with underscores (_).
So if you’re running a DOS batch file you could get to your
--throttle-upload setting by using
There are also some special non-option vairables that are probably what you’re intersted in:
- DUPLICATI__EVENTNAME = when script was triggered such as “BEFORE” or “AFTER”
- DUPLICATI__OPERATIONNAME = operation, such as “Backup”, “Cleanup”, “Restore”, etc.
- DUPLICATI__RESULTFILE = path to file in which result data is stored
- DUPLICATI__REMOTEURL = “URL” target backend
- DUPLICATI__LOCALPATH = path to folders being backed up or restored
- DUPLICATI__PARSED_RESULT = run result such as “Unknown”, “Success”, “Warning”, “Error”, or “Fatal”
So in your case (and assuming a DOS batch file) I’m guessing your script should start with something along the lines of
if *%DUPLCATI__PARSED_RESULT%* NEQ *Success* goto :EOF (or something like that).
Hey thanks… Yes I am running a .cmd file on Win7. Will need to test later. %DUPLICATI__PARSED_RESULT% returned an empty string, maybe it’s %DUPLICATI–PARSED-RESULT% … or I’ll send the output of “set” to a file to see what actually exists. I hope the variables operate in a global scope…
All files only have the “” characters in them. I.e., all variables were empty in the script.
It does not work this way
DUPLICATI__PARSED_RESULT status variable was introduced in v18.104.22.168-22.214.171.124_canary.
If you’re in the Experimental or Beta update channel, you probably use a version number that’s below 126.96.36.199.
As a workaround, you can use a script similar to this one to pull the parsed result from the result file:
Ah, there is a file, yes I can use this… I’m loving doing cmd magic Yes I am on experimental.
Btw I think Duplicati UI should show more support as for this topic.