Custom command before and after backup

Yeah, this is a known issue (though I can’t find the topic for it right now). At present the best way to handle this is to have your script \use the Duplicati environment variables to check that %DUPLICATI_OPERATIONNAME% = Backup otherwise abort the job:


Are you test running your commands through the web GUI Command line feature? If so, this is also a known issue where some of the pre-filled parameters are passed even if not needed for the selected command. I usually make it a point to blank out all fields not needed for my specific command and it seems to run OK.

Nothing done in the Command line window is “saved” so don’t worry - you won’t be wiping out your backup job settings or anything like that.