zfs_autobackup icon indicating copy to clipboard operation
zfs_autobackup copied to clipboard

Issues with Snapshot Format (Timestamp) and Thinning

Open norsemangrey opened this issue 10 months ago • 5 comments

I'm having an issue where old snapshots are not thinned when trying to resolve the snapshot format timestamp to a variable before passing it to the zfs-autobackup function.

I'm running multiple snapshot profiles in the same script and for the purpose of managing the snapshots later I would like them all to have the same timestamp in the snapshot name. Thus I'm trying to do something like in the below example, instead of passing timestamp format like this SNAPSHOT_FORMAT="%Y-%m-%dT%H:%M:%S-auto".

This works fine in that the snapshots are created and with the correct name, but thinning of old snapshots no longer works. Is this a bug, and if not is there another way to accomplish what I'm trying to do?

SOURCE_NAME=host-1
SNAPSHOT_FORMAT="$(date +%Y-%m-%dT%H:%M:%S)-auto"

zfs-autobackup SOURCE_NAME \
                    --keep-source=2 \
                    --property-format=snapshot-base:{} \
                    --snapshot-format $SNAPSHOT_FORMAT \
                    --exclude-received \
                    --progress \
                    --debug-output \
                    --verbose

zfs-autobackup SOURCE_NAME \
                    --keep-source=5,1d1w,1w1m \
                    --property-format=snapshot-pri-1:{} \
                    --snapshot-format $SNAPSHOT_FORMAT \
                    --exclude-received \
                    --progress \
                    --debug-output \
                    --verbose

norsemangrey avatar Mar 26 '24 16:03 norsemangrey