itzg / docker-mc-backup

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

Add an ENV Variable option to make a backup once a player got online (skipping the 1st Backup Interval) #207

Open FurkanVG opened 1 month ago

FurkanVG commented 1 month ago

Hi,

as mentioned on Discord, it would be cool to have the option to create a backup once a players gets online after the Player Interval Check.

Currently, the script would start the timer of the default backup interval (which could be 2h). In that case, the script would run a backup only after 2h a player got on.

Example how it is now:

  1. 00:01 - Server boots up
  2. 00:02 - Startup Backup enabled, 1st Backup
  3. 01:02 - 1h hit (if Backup Interval is 1h as example), 2nd Backup
  4. 01:45 - Players go offline, nobody online anymore
  5. 02:02 - 1h hit, Backup happens AND Then player check is 0
  6. 03:25 - Player got online, waiting 1h for next Backup
  7. 04:25 - 3rd Backup

With the option to do a backup right after a player got online, it would look like this:

  1. 00:01 - Server boots up
  2. 00:02 - Startup Backup enabled, 1st Backup
  3. 01:02 - 1h hit (if Backup Interval is 1h as example), 2nd Backup
  4. 01:45 - Players go offline, nobody online anymore
  5. 02:02 - 1h hit, Backup happens AND Then player check is 0
  6. 03:25 - Player got online, starting 3rd Backup
  7. 04:25 - 4th Backup

Thanks!