Simple Backups

Simple Backups

27M Downloads

Backups trigger on world enter.

bootzin opened this issue · 4 comments

commented

Minecraft version

1.20.x

Simple Backups version

1.20.1-3.1.6

(Neo)Forge version

47.3.0

The latest.log file

--

Issue description

Backups are triggered as soon as the world logs in, disregarding actual server ticks. This has made me effectively lose my backups since I tried logging a few times into a broken game and the backups got created with the broken version, while deleting the actual working backups.

Steps to reproduce

  1. Log into a game
  2. A backup is created

Other information

No response

commented

I'm sorry for you. But in this case, a log would be pretty helpful. Backups are created when there’s the configured time between last time and now. When logging in, it only happens when the last time a player joined is so far away that the configured time has passed. At least it should be like this. That’s where the log would be helpful I guess :)

commented

logExcerpt1.txt
logExcerpt2.txt
logExcerpt3.txt
logExcerpt4.txt

Added 4 excerpts from the logs I had. From the looks of it, it seems that they do indeed only trigger every X real world minutes, but since I spent quite a bit of time waiting to see if the world would load (waiting for the server to catch up), they were triggering every time I opened the game.

A similar behaviour I noticed is that the backup also gets triggered after the game gets unpaused after being paused for a long time (essentially having a very similar backup to the previous one)

commented

Maybe instead of relying only on System.currentTimeMillis() - CommonConfig.getTimer() > backupData.getLastSaved() to trigger the backup you could also have an internal tick counter?

commented

From your logs, I can see that everything works as intended.

Your idea of an internal tick counter is something I had before, but I did decide for the real time clock because of lagging servers which result in longer ticks, which result in much more times between backups as intended. An idea I now have is that I could try to implement a config option. Real time vs. tick based. That way, everyone can change the config to a tick based backup timer.

Tip

When you see that your world has some problems, always save some backups. It's better to keep a few more until you see that you don't need them anymore. And when you need the backups, you do have them.