khenderick/zfs-snap-manager

periodical snapshots

Closed this issue · 4 comments

a-sk commented

Hello and thank you for zfs-snap-manager.

It will be great if zfs-snap-manager could support periodical snapshots, maybe cron syntax (or something more human friendly), something like:

[zroot]
mountpoint = /
time = @every 5h:6m
snapshot = True
replicate_target = /backup/zroot
schema = 7d3w11m5y

What do you think?

That is a good idea, however, I'm not sure how the cleaning should behave with snapshots being taken e.g. every 3 hours.

Currently, it assumes one snapshot per day, keeping those for X days. Once the week bucket is hit, only one per week is kept and so on.

I first idea would be to introduce a XnXdXwXmXy scheme, where the Xn states how many days all snapshots should be kept, without cleaning. E.g. a 3a4d3w11m4y would keep all 3h snapshots (8 per day) for 3 days, then clean them out to one per day, keeping those for 4 more days, then clean them out to one per week, keeping those ...

And should the replication also replicate those multiple-per-day snapshots?

Hi - just found this and have yet to test it out but it looks to be both exactly what I was looking for and exactly what I would have written myself had I not found this! In terms of the cleaning though: currently you only keep one per week in the week bucket. Could you not simply institute an hourly bucket, and then keep one hourly in the daily bucket, in an analogous manner to how you roll from daily to weekly currently?

I think it could be done in same manner as snapper has implemented it for the BTRFS/LVM snapshots.
You just provide how many snapshots keep for every day, and how many snapshots are taken in current day.
http://snapper.io/manpages/snapper-configs.html

It would be very useful for home users, where computer is not running 24/7.
The first snapshot for hour should be taken right after system boot.

Regards,

I'm closing this issue as I unfortunately don't have the time anymore to maintain ZFS Snapshot Manager. I would like to point you towards the awesome tool zrepl which has nearly all of ZFS Snapshot Manager's features and much more.

In any case, thanks for being a part of this community.