Change the base directory of a backup?

I’m using Duplicati to back up data stored in ZFS. ZFS has a snapshot feature where you can atomically save the state of the filesystem, then find it in /<pool>/.zfs/snapshot/<snapshot name>. Is there a way to tell Duplicati to back up a directory like /tank/.zfs/snapshot/2020-02-03, but rewrite the paths to /tank when checking for changes in the db and saving?

Also, Duplicati works impressively well under Mono. I was expecting to be fighting with it, but it was as easy as mono <duplicati path>/Duplicati.CommandLine.exe, so cheers!

I don’t think that’s possible, but others have expressed interest in adding ZFS snapshot support to Duplicati.

Here is an improvement filed on Github: ZFS Periodic Snapshot integration · Issue #3862 · duplicati/duplicati · GitHub

And there are some threads in this forum where it’s been discussed before, such as this one: Any plans to support snapshots on the modern Filesystems (ZFS et. al)?

Do you mean changes in the source file snapshot? The files are walked and file path is file path.
There is pathname trickery possible with symbolic links, bind mounts, and similar, but be careful.

For mono, there are also some wrappers such as /usr/bin/duplicati-cli. Not everything has one…
Some systems will also know to run mono when they see a mono .exe. My Linux Mint does that.

others have expressed interest in adding ZFS snapshot support to Duplicati.

I actually don’t like the idea of ZFS integration because it would be pretty specific to ZFS, and if you really want a backup solution tailored to ZFS, you’re better off writing one from the ground up or sending snapshots.

Do you mean changes in the source file snapshot?

Not quite. Backup tools can have issues with locked files or files that are changed mid-backup. ZFS snapshots look like the full filesystem, just frozen at the time the snapshot was taken and in a different root directory.

You could definitely do some bind mount or chroot trickery, but this feature would just be a string replace on the file path before it’s uploaded or written to the DB. Now, that doesn’t mean it’s easy to add…

There is no support for this currently. As @ts678 mentions this can be done with bind mounts. Something like this for each backup:

mkdir /tankbind
mount -bind /tank/.zfs/snapshot/2020-02-03 /tankbind
duplicati-cli backup ...dest... /tankbind
umount /tankbind
rmdir /tankbind

The only difference between using the full path will be that Duplicati will be able to re-use the metadata from the previous paths, such that it does not need to re-hash the file to see if it has any changes.

It would be fairly easy to add (I think) but it is a wormhole of options and trouble to allow users to define a list of rewrite rules. Do you have an idea for how you would like to specify the rewrite rule on the commandline?

What about --base-path or --root-path, and all specified root paths are relative to it?