-
Notifications
You must be signed in to change notification settings - Fork 38
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
Cleanup service #16
Comments
We can solve this request via a systemd-units. |
It is not the solution but for people that want to keep just the latest backup I made a bash script that on Linux works for me, hope it helps someone... it's not very well written, I'm kinda newby feel free to make it better.
in order to work, the working directory ($PWD) must be the same as the snap-sync's destination folder to keep more than just the last one snapshot just augment Hope it helps someone.
|
I second this. Cleaning up sync'ed snapshots on the external disk, either manually or with a script similar to @FraYoshi's, seems to get snap-sync out of synchronization in some way that I don't understand. After deleting a few snapshots on my external, new runs of snap-sync complains about not being able to find the parent subvolume. Edit: I think my issue was because I deleted the external snapshot that corresponded with the latest incremental backup on my local drive. |
I've written a script called clean-snap-sync-external.sh to clean snapshots created by snap-sync on external volumes. It is inspired by @FraYoshi's above, but fixes a logic error and checks for a few corner cases:
|
I've also recently made snap-sync-cleanup in Python for my own personal use that does something similar as well. It's released on PyPI in case others want to use it. |
You know how difficult it is to delete multiple btrfs snapshots in different sub(!)directories. A cleanup service similar to snapper itself would be nice. You could set similar settings as snapper does for local configs, but not a time cleanup, more a number cleanup. Or you could provide a manual command to at least cleanup the backups easier.
The last option could be also used as systemd service (which should run after the backup). Depending on the setting you then have backups fr the last 3 weeks. Keeping every month is not possible like this because this might be way to complex to implement for now, but that is up to you.
The (default) setting or the number of backups to keep should be selectable in the snapper config itself, so you can keep more copies of
home
thanroot
etc. Or you can completely disable the cleanup for critical snapper configs.The text was updated successfully, but these errors were encountered: