hcloud-snapshot-as-backup icon indicating copy to clipboard operation
hcloud-snapshot-as-backup copied to clipboard

[Feature] More flexible schedule with rotate-backups

Open ToshY opened this issue 2 years ago • 3 comments

Request

Currently it's only possible to use a cron schedule for defining when snapshots are created. This is nice until you realise that you may require a more complex schedule.

As an example, I would also like to keep X weekly snapshots, keep Y monthly snapshots and Z yearly snapshots (ofcourse without manual intervention).

Possible implementation

Something that can be used to create a more flexible schedule is rotate-backups. This works quite well for things like database backups, so I assume it can be used for this as well.

ToshY avatar Nov 19 '22 20:11 ToshY

@ToshY Although this may come too late: I had similar requirements and ended up writing my own script. It can be found here: https://github.com/undecaf/hetzner-snap-and-rotate

Maybe it can help!

undecaf avatar Jul 29 '24 09:07 undecaf

Hey @undecaf 👋

It's never too late. I will check it out. Thanks for letting me know.

ToshY avatar Jul 29 '24 09:07 ToshY

As an example, I would also like to keep X weekly snapshots, keep Y monthly snapshots and Z yearly snapshots (ofcourse without manual intervention).

This is already possible with the script by using custom labels and starting the container multiple times. For example, I have one container running for daily backups, one for weekly and one for monthly. With the custom label and cron, the containers only take care of their snapshots and create snapshots exactly as you described.

fbrettnich avatar Aug 06 '24 14:08 fbrettnich