Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping a minumum number of backups #104

Open
jacobmichels opened this issue Aug 24, 2022 · 3 comments
Open

Keeping a minumum number of backups #104

jacobmichels opened this issue Aug 24, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jacobmichels
Copy link

jacobmichels commented Aug 24, 2022

Is there any way of keeping a minimum number of backups safe from being pruned? I'm worried about setting PRUNE_BACKUPS_DAYS and PAUSE_IF_NO_PLAYERS=true at the same time, because, if my understanding is correct, if the server goes PRUNE_BACKUPS_DAYS days without any players then all backups would get deleted.

Maybe adding a new option like MIN_BACKUPS could be a solution to this.

@itzg
Copy link
Owner

itzg commented Aug 25, 2022

That's a great point and suggestion.

@itzg itzg added the enhancement New feature or request label Aug 25, 2022
@Norsagir
Copy link

I agree, this option could really help :)

@Yanni-X
Copy link

Yanni-X commented May 29, 2023

Maybe not useful for development of this feature, but in the meantime you can use a CRON job to at least copy the latest backup with a .backup file ending so that it doesn't get pruned. Mine looks like that, you probably need to adapt the directory.

0 1 * * * cp -p "/home/docker/mc-backups/`ls -t1 /home/docker/mc-backups| head -n 1`" /home/docker/mc-backups/latest.tgz.backup

it copies the latest backup, and if latest.tgz.backup is the latest one, it doesn't do anything. And the prune-script will not prune it because it only looks for *.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: To do
Development

No branches or pull requests

4 participants