Thanks in advance for your help.
I want to create a backup onto an external USB drive which mounts as an NTFS drive at /media/username/External, but the device isn’t always attached to the computer running Duplicati. My worry is that when the device isn’t connected, it’ll create the necessary folders and write to them (hindering the next mount at that mount point.)
Deja-Dup in Ubuntu can avoid making backups to an empty /media/username/External until the device is reconnected, but I can’t find a setting to do the same in Duplicati.
I see that Duplicati will perform backups if a scheduled time is missed, but can it do the same for disconnected devices?
You could use --run-script-before, have it check for the presence of the drive, and then exit the script with a certain errorlevel to prevent the backup from running.
There actually are settings for this, though I still think making the mount point immutable is the best option, along with using /dev/disk/by-uuid in your fstab and specific mount names so you don’t mix things up.
The setting involves two options: “alternate-target-paths” and “alternate-destination-marker”.
The first checks to see if the target path exists (e.g., /media/duplicati_a/photos), which wouldn’t exist if your drive weren’t mounted. Then you can add a destination marker filename and place that file in the destination folder. So my alternate destination marker file is “photos_duplicati_a_marker” and I just touch that filename in the mounted USB drive to create it.