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

--no-snapshot --keep-source=0 does not delete all snapshots #53

Open
fhriley opened this issue Aug 27, 2020 · 8 comments
Open

--no-snapshot --keep-source=0 does not delete all snapshots #53

fhriley opened this issue Aug 27, 2020 · 8 comments
Labels
Milestone

Comments

@fhriley
Copy link

fhriley commented Aug 27, 2020

Those options tell zfs-autobackup to not create a snapshot and keep 0 snapshots, but zfs-autobackup is hardcoded to keep the last snapshot. zfs-autobackup should not override what I asked it to do.

@psy0rz
Copy link
Owner

psy0rz commented Aug 27, 2020

True, this was originally to prevent people "shooting them self in the foot" and accidentally deleting the common snapshot.

However in snapshot-mode this makes sense i guess. And even if you want to do a one-time synchronization and delete the source snapshot after its complete?

Will fix this.

A --keep-target=0 doesn't make sense, right? :)

@psy0rz psy0rz added the bug label Aug 27, 2020
@psy0rz psy0rz added this to the 3.0 milestone Feb 2, 2021
@psy0rz
Copy link
Owner

psy0rz commented Feb 2, 2021

hmm.. i realise that keep-target=0 also is usefull for onetime replication .

@psy0rz
Copy link
Owner

psy0rz commented Feb 2, 2021

I've made some preparations for this.

It will be called --keep-source=cleanup and --keep-target=cleanup, to indicate we really want a cleanup. E.g.: delete all snapshots belonging to this backup and breaking the backup.

Specifying 0 will become an error and inform the user of the cleanup if he really wants that.

@psy0rz psy0rz modified the milestones: 3.0, 3.1 Mar 16, 2021
@psy0rz psy0rz modified the milestones: 3.1, 3.2 Jul 3, 2021
@dreadedhamish
Copy link

I've made some preparations for this.

It will be called --keep-source=cleanup and --keep-target=cleanup, to indicate we really want a cleanup. E.g.: delete all snapshots belonging to this backup and breaking the backup.

Specifying 0 will become an error and inform the user of the cleanup if he really wants that.

How will this "break the backup"?
I've got 1 drive that is space constrained, so I'd like to keep zero snapshots on the drive itself.

@Scrin
Copy link

Scrin commented Sep 15, 2024

With no snapshots zfs won't be able to know what has changed since the previous backup run, so the next backup would fail because the setup is effectively broken at that point, and fixing it usually requires destroying the target which is usually not desired

@dreadedhamish
Copy link

With no snapshots zfs won't be able to know what has changed since the previous backup run, so the next backup would fail because the setup is effectively broken at that point, and fixing it usually requires destroying the target which is usually not desired

OK I think I get it - the primary snapshot can only be in the original pool - I can put a snapshot that automatically grows somewhere else. So my options are to increase the size of the original pool, or take more frequent snapshots so the primary growing one doesn't get too large.

@Scrin
Copy link

Scrin commented Sep 16, 2024

Yes, taking backups more frequently will allow the snapshot(s) on the source to stay smaller (also depends a lot on how the dataset is used, written to). The thinner can then take care of deleting unnecessary intermediate snapshots on the target so more frequent backup runs wont hurt your disk consumption there either

@psy0rz
Copy link
Owner

psy0rz commented Sep 17, 2024

How will this "break the backup"? I've got 1 drive that is space constrained, so I'd like to keep zero snapshots on the drive itself.

For an explanation see this: https://github.com/psy0rz/zfs_autobackup/wiki/Common-snapshots-and-holds

Also: bookmark support #23 would solve this, since they dont use space on the source.

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

No branches or pull requests

4 participants