itzg / docker-mc-backup

Provides a side-car container to backup itzg/minecraft-server server data
https://hub.docker.com/r/itzg/mc-backup
MIT License
334 stars 52 forks source link

FEATURE: Extend scope of "PRUNE_BACKUPS_*", to support x amount of backups, and maybe even "x amount of space used" #98

Open exetico opened 2 years ago

exetico commented 2 years ago

Hi,

I've tried to look through the docs and the code for a "max amount of backups", or "max amount of space" before backup-deletion.

Would you consider to expand the scope to include that?

(Today I filled up our server, by creating a backup every 30 minute :smile:. I guess it's overlapping a bit with restic, but I'd like to keep it simple)

Thank you for the solution, btw.

itzg commented 2 years ago

Yes, that sounds like a great idea. A PR would be welcome, but I'll also queue this up.

hpf3 commented 4 months ago

possible partial implimentation with https://github.com/itzg/docker-mc-backup/pull/194

wyne commented 3 months ago

I've always thought of doing this with a sort of exponential backoff like how Realms does it.

For example, logrotate-style:

/backups/* {
    # Rotate daily and keep 7 days of daily backups
    daily
    rotate 7
    missingok
    notifempty

    # Keep weekly backups for 3 months
    weekly
    rotate 13
    dateext
    dateformat -%Y%m%d

    # Keep monthly backups for 1 year
    monthly
    rotate 12
    dateext
    dateformat -%Y%m%d

    # Keep yearly backups forever
    yearly
    rotate 0
    dateext
    dateformat -%Y%m%d
}
exetico commented 3 months ago

Another way would be to look into some sort of restic powered backup, where the user only need to provide a "configure string" or similar (supporting multiple parameters). But I'm not sure if you'd allowed to bundle that in the solution. Just another input, as I really like restic.

itzg commented 3 months ago

Restic is already supported

https://github.com/itzg/docker-mc-backup?tab=readme-ov-file#restic

exetico commented 3 months ago

@itzg ; I see. Good to know. But a build in "default easy-mode solution" would be great, too.

It's clear that I didn't use Restic that much back in 2022, or, didn't see that as easy, as it can be: image

itzg commented 3 months ago

I don't know or use Restic, so will need to rely on a contributor to add an "easy mode".