Hello,
I recently purchased duplicacy web, switching from Duplicati and found out I can run pre/post scripts before and after my backup jobs. I need these scripts since I use ZFS, to create a ZFS snapshot and then change the backup directory to that snapshot mount to backup. Then the post script removes the snapshot.
Duplicati, in it’s pre post scripts have built in environment variables, specifically the variable “DUPLICATI__LOCALPATH”. This allows you to tell Duplicati to actually backup from a different directory after the backup has started, allowing the configuration to keep the original location of the files, making restores among other operations more convenient.
Does Duplicacy have similar options for me to configure so that I can use ZFS snapshots with duplicacy web? I have posted an example script I used with Duplicati below.
Thank you,
[root@server /]# cat /mnt/ssd/bin/duplicati_snapshot_create_mount #!/usr/bin/env bash ZFS_FS_NAME=$1 ZFS_SNAPSHOT_NAME=$2 MOUNT_PATH="/mnt/tmp/snapshot" if [[ ! -z "$(ls -A $MOUNT_PATH)" ]]; then printf "[ERROR] The backup mount directory, $MOUNT_PATH is not empty.\n" exit 1 fi if [[ -z "$(zfs list | grep $ZFS_FS_NAME)" ]]; then printf "[ERROR] The ZFS filesystem $ZFS_FS_NAME does not exist.\n" exit 1 fi if [[ ! -z "$(zfs list -t snapshot | grep "$ZFS_FS_NAME@$ZFS_SNAPSHOT_NAME")" ]]; then printf "[ERROR] The ZFS snapshot $ZFS_SNAPSHOT_NAME already exists.\n" exit 1 fi zfs snapshot -r "$ZFS_FS_NAME@$ZFS_SNAPSHOT_NAME" mount -t zfs "$ZFS_FS_NAME@$ZFS_SNAPSHOT_NAME" "$MOUNT_PATH" echo "--localpath=\"$MOUNT_PATH\"" if [[ -z "$(ls -A $MOUNT_PATH)" ]]; then printf "[ERROR] Snapshot was created but failed to mount. (empty directory)\n" exit 1 fi printf "[INFO] Snapshot was created and mounted. Ready for duplicati.\n" exit 0