Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cooperate with autosnap generated snapshots? #44

Open
mayli opened this issue Nov 20, 2020 · 2 comments
Open

cooperate with autosnap generated snapshots? #44

mayli opened this issue Nov 20, 2020 · 2 comments

Comments

@mayli
Copy link

mayli commented Nov 20, 2020

The "smart" send is likely to send a zfs-auto-snap_frequent one. Later once the zfs-auto-snap_frequent get deleted from local host, zfsbackup will get confused and refuse to backup any further.

@someone1
Copy link
Owner

It's somewhat out of scope for this project to handle all cases of how you manage your snapshots, you can script execution of this project manually according to how you manage snapshots.

How would you like to handle these cases? What's the expected behavior?

@mschout
Copy link
Contributor

mschout commented Feb 4, 2021

Couple of things here.

One: zfsbackup-go has a --snapshotPrefix param so you can tell it to e.g. only consider the daily or hourly snapshots. I submitted this feature precisely to deal with this scenario.

Two: It is probably better to have a separate set of snapshots that are only rotated when the backup runs. My strategy is to use zfsbackup-go as the snapshot label, and my wrapper script that runs the backup does this:

# create a new set of snapshots
zfs-auto-snapshot --label=zfsbackup-go //

zfs list -H -o name,com.sun:auto-snapshot | while read line; do
  # run zfsbackup-go, unless com.sun:auto-snapshot is "false" ...
  ...
done

# delete old snapshots.
zfs-auto-snapshot --destroy-only --keep=1 --label=zfsbackup-go //

Side note: there is a bug in zfs-auto-snapshot where you need to set --keep=2 unless you have patched around it. See zfsonlinux/zfs-auto-snapshot#121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants