4

Sorry in advance, this question could fall into 1 of 3 categories (server admin, gaming, or programming)

I'm working on a personal Minecraft server for my friends and I, I'm having the server back itself up on an interval, which requires the commands save-all and save-off to be called in succession before creating the backup file. (afterwards, save-on is called to put everything back to normal)

I'm monitoring the server's output/log to determine when the saving is off so I can create the backup. However, the server's response to my save-off command indicates it is ready, but when I go to make a backup, the world files are modified again, breaking my backup.

So far, my only solution is to add a delay between save-off and backup, but surely I'm either missing something or I can report this to Mojang so it can be handled a bit better. FWIW, I get the same behavior both on the latest stable version, as well as the latest snapshot.

Do save-off or save-all give any other sort of indication as to whether they are fully completed?

NOTICE I've created a bug-tracker issue with Mojang, we'll see what they have to say. :)

11
  • How do you send those commands to the server?
    – Bobby
    Commented Jun 28, 2012 at 18:41
  • I'm writing to stdin for the minecraft_server.jar process Commented Jun 28, 2012 at 20:01
  • Did you try the save-off, then save-all order? That's what I'm using (with a 10 sec delay between save-all and the tar call, good enough for me).
    – Maerlyn
    Commented Jun 28, 2012 at 20:40
  • save-off first? Hmm, I'll give that a try! Commented Jun 28, 2012 at 21:20
  • Fantastic! Calling save-off before save-all was exactly what I needed to do! Please add this as an answer so I can give you some rep. :) Commented Jun 28, 2012 at 21:30

3 Answers 3

7

You should call save-off first, save-all afterwards. This makes sure the world gets completely saved, and no save will occur during the creation of you backup.

0

Try deleting session.lock, as it's generated each time the world is loaded. If you are running a server, you must restart the server after deleting the session.lock file. If you're running Minecraft, you should re-log for the changes to take effect. By re-log I mean to exit to the title screen and then reload the world.

-1

Dominic, you were doing the right thing and in the correct order:

'save-all'; 'save-off'; Wait some time (say, 30 seconds, or more); Do the backup; 'save-on'

As far as I know, there is no way around the waiting. You either have to monitor the writing to the "world" directory by some filesystem event tool (inotify(7)) or wait for a fixed duration before backing up the data.

Doing 'save-off' first, as proposed by some here, is just wrong, as it disables the saving operations in 'save-all'; see e.g. http://www.minecraftforum.net/forums/support/server-support/server-administration/1892430-save-off-breaks-save-all

In many cases you might not notice a difference, since the world is pretty frequently synced by auto-saving, anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.