lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.89k stars 269 forks source link

Feature Request: Provide a `BACKUPS_MIN_COUNT` environment variable that would override any of the `BACKUPS_MAX_*` values #637

Open jonvel opened 1 year ago

jonvel commented 1 year ago

Scenario: I have a slowly changing server (I log in maybe once a week, and other players may login less frequently than that), that might only have players a couple of times per year (or longer). I don't want to age off backups older than d days (BACUPS_MAX_AGE=d), as it might be d+1 days since the last time someone has logged in to the server, for an arbitrary value of d.

This value of BACKUPS_MIN_COUNT would ensure that at least N backups existed, regardless of how old those backups were, and would therefore not delete any backups older than BACKUPS_MAX_AGE if there aren't at least N available.

You can somewhat replicate this by setting BACKUP_MAX_AGE to an absurdly large number (tens of thousands), and setting BACKUP_MAX_COUNT to whatever number of backups you'd want to keep, but that seems ... absurd ... 😃

barnhill commented 2 months ago

This is a good idea as I have the same setup and once we finish some content it might be months before we play again.