Open MrMarlin opened 4 years ago
That could be nice to add indeed! As a workaround for now it is possible to achieve this by having multiple config files and running the goutte once per config.
This was my first idea. But wouldn't my weekly config with retention=4 prune some of my weekly snapshots with retention=7, since there is no differentiation in the prefixes?
Ah yes you're right, sorry it's been a while! I will see to refactor goutte to accept something like:
[droplets]
default_retention = 5
[[droplets.by_name]]
name = "server01"
retention = 3
[[droplets.by_name]]
name = "server02"
[[droplets.by_tag]]
tag = "prod"
retention = 20
[volumes]
[[volumes.by_name]]
# ...
Oh I see I have described my idea a bit vaguely. I didn't mean different retentions for different volumens/droplets (this is also a really nice feature to have), but to have gaps between retentions of the same item.
For example I have a volume my_volume. For this volume I want multiple snapshots within the following timeframe:
So if I want to store a 10 month old snapshot, I don't have to keep 200 snapshots. At full retention this would only store 21 Snapshots (7+3+11)
Does that explanation make the idea a bit clearer? It's kinda hard to describe.
Ah yes I see, totally makes sense!
One simple way to do it in conjuction with my change proposed above would be to update the snapshot naming to something like goutte-{??}-{droplet}-{date}-{hash}
.
???
could be either the name of the config file or a name
parameter from the config.
That would let you run:
goutte daily.toml
which would create goutte-daily-server01-{date}-{hash}
with retention of 7goutte weekly.toml
which would create goutte-weekly-server01-{date}-{hash}
with retention of 4Another way would be to completly change the internal logic, and define it in a cron style and jobs should check existing snapshots, compare it to the actual time and decide if it should start a snapshot. But that seems clunky as it's not a constantly running software.
A yeah I see. So your first suggestion would work like a charm. Would really appreciate, if it was implemented. Thank you!
Will be reworked in a new version 2
It would be nice, to be able to set multiple retention "scope" like, keep: