I am running Duplicati on Ubuntu 22.04. I wrote a simple MySQL backup script and want it to run before each backup. The script saves the backup (mysqldump) in /home/user/backups/. I then ran a backup last night. It appears to have worked as I did a restore this morning, and the restored mysql backup file was correct. However, it seems every time I run a restore, my script is run and more backups are created. I now have 8 copies of the mysql backup file in my backups directory - 1 from last night and 7 from today when I went through the restore process. How do I set up the script to only run when I am doing a backup? I am using run-script-before-required.
Do I need to check the value of DUPLICATI__OPERATIONNAME, and just run the script when the value is “Backup”? Do I need to check any of the other Duplicati env variables to achieve running the script only for a backup?
Thanks!