I’m trying to run a script (I already tested it standalone and it works fine) to run before a backup on duplicati.
On the advanced tab, I add a new option named “run-script-before”, and write the path to the script.
However, it never runs, it always display the same warning: " [Warning-Duplicati.Library.Modules.Builtin.RunScript-ScriptExecuteError]: Error while executing script “D:\wake-up.ps1”: The specified executable is not a valid application for this OS platform."
While it might run command, I don’t think it will run a command and arguments, the way it’s done now:
It hasn’t set ProcessStartInfo.Arguments Property which is a string giving its command line arguments which are interpreted by the application, although on Windows it might do it per Windows conventions. Linux compatibility worries me a bit, as Linux applications rely on shells to deliver parsed args to them.
Having shells involved begs the questions of how to pick what shell, and can malicious ones be put in? subprocess — Subprocess management explains how Python used to fall for those, but it’s been fixed.
execvp(3) - Linux man page explains its couple of tricks, such as how it can do PATH search, or handle ENOEXEC error by passing the file to hardcoded /bin/sh to see if it can handle given file successfully.
It might be nice if Duplicati can safely (keeping compatibility with all current simplistic uses) upgrade to handling arguments directly. Current workaround is a batch file wrapper. If not, maybe add new option?
im sorry but i’m not very tech savy and was hoping there was a more straightforward way to do what I had in mind. The ony way I made that simple script to turn on the pc was using the AI on chat gpt. Howver I’m gonna try and read what you wrote on the previous post.
Scripting options describes your options, basically before and after, not in chosen spots in the middle. Posssibly you could start something before that would poke the remote until an after script stopped it.
As gaps in activity can happen in many places, I don’t see why you would NOT want constant keepalive, however seeing phases is easier on command line, maybe especially with third-party duplicati-client tool.