I use run-script-before-required to load shares since I use my Ubuntu server to back up LAN machines (not quite how Duplicati was intended, but I want to manage backups centrally and I also use it to back up remote client systems).
I store my scripts in /usr/local/bin/, and they are bash shell scripts.
Here’s an example of the text in the config box for one of my backups, it’s an absolute path:
/usr/local/bin/mount-mypc.sh
The script starts with the shebang line:
#!/bin/bash #then some comments about what it does would go here
#Read a few variables
EVENTNAME=$DUPLICATI__EVENTNAME
OPERATIONNAME=$DUPLICATI__OPERATIONNAME
REMOTEURL=$DUPLICATI__REMOTEURL
LOCALPATH=$DUPLICATI__LOCALPATH
#Make sure my mount point exists
if [[ ! -d “/mnt/$host” ]] ; then
mail $fatalnotify -r “myemail” -s “FAILED MOUNT: $mount” <<< “$host does not exist in /mnt. This is a CRITICAL failure and the operation $OPERATIONNAME cannot continue.”;
logger -t “FAILED MOUNT…$host does not exist in /mnt. Exiting.”
exit 1
fi
etc. (note there are variables in that snippet that aren’t defined here - I know it’s poor form but I don’t have time to scrub my whole script for posting on the internet, and this should be enough to get you started.)
If the script exits with status 0, the backup continues. If you send an exit other than 0, it will stop and show a fail. That’s why you see the exit 1 in the snippet above, since the mount point not existing would mean the backup can’t continue.
In your case you’d want to do a mysqldump and probably check the size of the output or something like that.