EssentialsX

EssentialsX

2M Downloads

Automated Backup Not Working As Expected

DuckDuckWhale opened this issue ยท 4 comments

commented

Information

Full output of /ess version:

Server version: 1.14.3-R0.1-SNAPSHOT git-Paper-120 (MC: 1.14.3)
EssentialsX version: 2.17.0.0
LuckPerms version: 4.4.1
Vault version: 1.7.2-b107
EssentialsXSpawn version: 2.17.0.0
EssentialsXChat version: 2.17.0.0
EssentialsXGeoIP version: 2.17.0.0

Server log: https://gist.github.com/DuckDuckWhale/0dc84a8c1fda790c64bea3fcc8982247#file-latest-log
EssentialsX config https://gist.github.com/DuckDuckWhale/0dc84a8c1fda790c64bea3fcc8982247#file-config-yml

Report of undocumented behavior

Behavior
I wrote the settings in config.yml, started the server, and backup was never ran. Instead I log in the server as a player, and the automated backup ran only then and stopped again after I went offline.

Details / Problem
Automated backup was ran every minute (this is set for testing purposes) when players are online, not every minute after the game starts as expected. When the server is empty, the backup never happens. The source of this behavior seems to be in https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/Backup.java.

I started the server and expected the backup to start, but it never did. Although no one was playing on the server, I wanted to back it up once in a while since there is a village at spawn and I wanted to be able to revert the world if it was destroyed by zombies and pillagers. This undocumented behavior took me a day or so to figure out, and meanwhile all villagers were killed.

This could cause troubles for small server owners, who would wonder why the automated backup is not backing up. It could also be detrimental to servers running dangerous farms at spawn as the server won't be able to revert if the farm blows up if no players are online.

Suggestions

Could you please do one of the following (in order of preference):

  1. Add a switch in config.yml to toggle between starting backup only when there are players online / at all times.
  2. Change it to backup at all times.
  3. Document this behavior in config.yml if this issue can't be solved in the ways above.
  4. Document this behavior in some sort of Wiki attached to this project if this issue can't be solved in the ways above.

Thank you!

commented

The backup functionality is unchanged from upstream Essentials and is documented on their wiki:

The backup will run every interval (defined in the config file) assuming that there was changes made to the server since the previous backup.

While this is unclear, I would guess that the assumption that "there was changes made to the server" is based on whether any players were logged in between backups. While this probably held true when this was first implemented, it is now not always the case especially if automated farms/machines are built in an area that's kept loaded.

We could add a always-run-backup option to the config that controls whether backups are skipped to address this without changing existing behaviour.

commented

That works! When can we expect such a change?

It seems like I forgot to check the Wiki for the original Essentials... I ran an experiment of using setblock at the server console, and the backup is still being skipped. Also, if I keep logged in while doing absolutely nothing it still backed up. Thus it seems like the "changes made to the server" only means that there are players online and not even block changes.

Could you also document this behavior somewhere in EssentialsX to clarify it for other users?

commented

At the end of a backup, if there are no players online it will stop running the auto-backups until someone logs in again.

I can't guarantee anything with regards to implementing a new config option - I don't currently have time to work on this.

commented

This has now been implemented - in the latest build you can enable the backup.always-run option to enable always running backups even when no users have logged in since the last backup. You can download the latest version from the EssentialsX website.