itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.12k stars 209 forks source link

Assure data is in good state for backup #71

Open flickerfly opened 4 years ago

flickerfly commented 4 years ago

Itzg and I discussed this a little while back when I put together the backup stuff. He pointed out the /save command and that it would be good to issue it before a backup, but neither of us had a good solution to making that happen. As I understand it, this makes sure to drop all contents in ram to the database to assure consistent backups.

I currently see a couple opportunities here:

  1. Simply gracefully shutdown the pods, run the backups and restart.
  2. Figure out a way to issues commands into a running pod (sidecar maybe?)

The first is the easiest I expect. I'm thinking about converting the backup pattern to a Job instead of a constantly running Pod managing its own schedule.

The second would be the most useful as the ability to push commands of any type would be more globally useful for other things. I think it would interesting to run a server that was creative in the morning and survival in the afternoon or otherwise automate activity through commands. This does seem like currently the harder objective though so it may need some iterative activity to get there.

Basically, looking for thoughts in the community on this.

itzg commented 4 years ago

My prevailing thought it is enhance https://github.com/itzg/entrypoint-demoter to optionally open a simple REST endpoint for sending commands to the stdin of the bedrock server process. That would be more doable by making some assumptions like only returning one line back of the stdout from the process for each command issued...or maybe it shouldn't bother to return any of the stdout for the command issued that way.