Hello,
I am looking for an unique identifier which can be used in scripts which are triggered in “run-script-before” and “run-script-after”.
My use case is the following:
a script which is triggered by “run-script-before” is creating a logging-record in a database indicating that a specific backup has been started, including the start time
another script which is triggered by “run-script-after” updates the record with the status of the backup and the end time
How can I tell the second script which record should be updated?
Some of this is OS-dependent and script language dependent, and there is better info on the Internet.
If your second script can read data from a file (or dot-source something in Linux style), that may work.
On Windows, PowerShell might be able to do that. I haven’t found any claims that a .bat script can…
Duplicati does have a feature that may help. You can change options by “before script” writing output:
Below, pre.bat is run before the backup, and set.bat is run after the backup, and picks up the variable: