MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers
https://minecraftservercontrol.github.io
BSD 2-Clause "Simplified" License
479 stars 61 forks source link

Purge old backups? #327

Closed eric-sabe closed 1 year ago

eric-sabe commented 1 year ago

Is there a recommended way to purge backups older than x days? Trying to save money on my cloud storage bill. :)

zanix commented 1 year ago

You can set mscs-backup-duration in /opt/mscs/mscs.defaults This is the length in days that backups survive. A value less than 1 disables backup deletion. The default is 15.

Backups are cleaned up whenever you run the backup command based on the duration set in mscs.defaults.

If you want to manually trim old backups, you can run the following:

rdiff-backup --remove-older-than 15D --force /opt/mscs/backups/WORLD

Replace 15 with the number of days to trim Replace WORLD with the world you want to trim the backups for

More info about backups: https://minecraftservercontrol.github.io/docs/mscs/backups More info about mscs.defaults: https://minecraftservercontrol.github.io/docs/mscs/adjusting-world-server-properties

zanix commented 1 year ago

I just noticed the backup cleanup was split off the main backup function, maybe this can be exposed as a command option.

zanix commented 1 year ago

Added a PR to expose this function as clean-backups