Automate Backups for a single player world?

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

Silas

New Member
Jul 29, 2019
56
0
0
What would be the best way to back up a single player world while playing? I have had a few minor chunk resets and would like a backup that would allow me to rollback my world 10-30minutes.

It would need to have little to no interaction by me after the initial setup. Set it and forget it so to speak.

Is there a way to do this?

1.6.4 custom world and just on local computer.
 

Sphinx2k

New Member
Jul 29, 2019
195
0
0
The Problem with a backup while playing is if the game writes in a file the moment you back that file up you get chunk resets.
So i tested if this commands work on ssp and they don't work.
save-all Forces the server to write all pending changes to the world to disk.
save-off Disables the server writing to the world files. All changes will temporarily be queued.
save-on Enables the server writing to the world files. This is the default behavior.

So why not running a local server (external für SMP, SSP is also local server but that is not what i mean :) ) and connecting to that one? I did this some times while testing and got better performance on that slow PC. Maybe because 2 really different threads?
So you can script it like:
save-all
save-off
<Backup like a simple file copy>
save-on

---
Setting a Timer for every 30min.
Escape->"Save and quit to titel"
double click a batch file like:
robocopy c:\minecraft c:\backup\minecraft /mir
and then reopen the map.
It should only take some seconds to do it and switching to main menü and back on the map is fast. No need to end the whole game.


Maybe with special backup software capable of saving open files or volume shadow copy features could help too.
 

Tyrindor

New Member
Jul 29, 2019
331
0
0
The Problem with a backup while playing is if the game writes in a file the moment you back that file up you get chunk resets.

Correct me but i'm wrong but this would only make the backup have a chunk reset. Your main world/main save would still be fine to my knowledge. You just need to keep multiple backups, so in the rare case it backs up the same time the world is saving, the next backup in ~15 minutes would be fine, as well as the previous backup. Which still beats losing an entire world due to not having a backup of any kind.
 

Sphinx2k

New Member
Jul 29, 2019
195
0
0
Correct me but i'm wrong but this would only make the backup have a chunk reset. Your main world/main save would still be fine to my knowledge. You just need to keep multiple backups, so in the rare case it backs up the same time the world is saving, the next backup in ~15 minutes would be fine, as well as the previous backup. Which still beats losing an entire world due to not having a backup of any kind.

I can only write to me knowledge. One time i made a backup of our Server while it was running (and not in save-off mode) that caused some chunk resets.
So if minecraft opens a file to write chunk data the backup process cannot copy this file. -> Missing chunk in Backup.
If you Backup and minecraft opens a file for write it cannot do this -> Possible Chunk reset in minecraft (i don't know if the write is then just delayed or completely abandoned).

The better way is to generate a clean backup directly.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
I have a simple batch script that I run before launching MineCraft. I can post it if you like. I find that dropping out of MC and reloading every so often is a good idea anyway.