MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers

Home Page:https://minecraftservercontrol.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

critial data loss bug, all backups purged by restore command, because they were older than 15 days

heathfx opened this issue · comments

this is a critical data loss issue because of a very bad behavior of the backup-restore command. I just attempted to revive a server that failed 6 months ago...which means 6 month old backups.

when I ran "mscs restore-backup my-server the-last-backup-date", it thought it would be wise to purge everything older than 15 days which is everything....SMH.

...AND purge everything before even restoring a single piece of data.

backup pruning should NEVER EVER be performed as part of a restore command! AGAIN a backup restore command should NEVER NEVER NEVER EVER delete data from the backup storage!!

luckily I didn't try to restore directly from my backup disk, but this could have nuked everything i had... built by a community of 180 players that needed a place to call home during the pandemic.

Confirmed, restore-backup runs a backup before performing a restore.
https://github.com/MinecraftServerControl/mscs/blob/main/msctl#L3294

And the backup process runs a prune after the backup.
Either worldBackup needs an argument to not prune or worldBackup should be removed from restore-backup

We should get this fixed. I'll have to take a closer look at this, but I think the worldBackup function should not be running the prune. It should be done in a separate function that can be called as necessary to retain the original intended functionality.

This should now be fixed with PR #326.