[Mod]Simple map backup [0.1][backup]

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

[Mod]Simple map backup [0.1][backup]

by webdesigner97 » Mon Jul 15, 2013 18:31

Hello,
some players have the problem that their maps don't save anymore. That's because one or more files in the world directory are damaged and need to be replaced with a copy from a backup. The problem is, that many players don't have backups of their worlds, so if their maps won't get saved anymore, they'll put a random file there with a different seed which makes the world look ugly. The mod is very simple and does NOT copy any player information and map.sqlite. Also I does NOT automatically recover corrupted files! If you find out that your map doesn't save anymore, you just have to copy the files in minetest/mapbackup/worldname to minetest/worlds/worldname (override old ones)
This mod copies the following files of your worlddirectory to minetest/mapbackup/worldname:

* auth.txt
* env_meta.txt
* ipban.txt
* map_meat.txt
* rollback.txt
* world.mt

The files are copied only once: When you first enter your world. To manually backup them, just run /backup.

Depends: none
License: WTFPL
Download: Dropbox

Singleplayer only
Last edited by webdesigner97 on Tue Jul 16, 2013 09:35, edited 1 time in total.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Tue Jul 16, 2013 09:34

Fixed a bug which didn't copy map_meta.txt.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jul 16, 2013 10:48

Are you sure its safe to access the files while minetest is running?
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Tue Jul 16, 2013 11:24

When else should I access them if this is a mod? And I just open them in read-mode, so I think nothing bad will happen :D
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Tue Jul 16, 2013 16:30

I have a batch file that copies my world and even creates a secondary backup. It deletes the secondary backup then renames the current backup to be secondary and then copies the world files for the current backup.

EDIT: For clarity.
Last edited by LionsDen on Tue Jul 16, 2013 16:30, edited 1 time in total.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Tue Jul 16, 2013 16:46

LionsDen wrote:I have a batch file that copies my world and even creates a secondary backup. It deletes the secondary backup then renames the current backup to be secondary and then copies the world files for the current backup.

EDIT: For clarity.

Also nice. But not everybody can create batchfiles, so this mod could be an altennative. I'll make it better someday, so it will automatically detect if your env_meta.txt is broken :)
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Tue Jul 16, 2013 17:09

Worlds / Server's won't start if env_meta.txt is broken. So that code would be pointless. Although a man may dream...

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Tue Jul 16, 2013 17:55

Jordach wrote:Worlds / Server's won't start if env_meta.txt is broken. So that code would be pointless. Although a man may dream...

But id the file breaky while the server is running? That happened 2 times on my singleplayer world :O
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Wed Jul 17, 2013 15:48

webdesigner97 wrote:Also nice. But not everybody can create batchfiles, so this mod could be an altennative. I'll make it better someday, so it will automatically detect if your env_meta.txt is broken :)


In the meantime, people can do what I do. I just modified my batch copy file so it can work with only 1 input required. To use it:

1. Create a directory named Backup in your worlds directory.

2. Copy the text in the code box below.

3. Open a text editor and paste the text into it.

4. Save the file to the Backup directory created in step 1 as "something.bat" without the quotes.
The something can be anything, I use bakup.bat as the name for it.

5. Whenever you want to backup a world, just go to that directory and run the batch file. It will prompt you
for the world's name. Just enter it and if the world exists exactly as you typed it. it will copy it.

I know this works in Windows XP, I don't have any other windows version to test it on.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
SET /P DNAME=World to Backup:
IF EXIST "%DNAME% Prev" RD /S /Q "%DNAME% Prev"
IF EXIST "%DNAME%" RENAME "%DNAME%" "%DNAME% Prev"
MD %DNAME%
IF EXIST "..\%DNAME%" XCOPY "..\%DNAME%\*.*" "%DNAME%\*.*" /E


Hope this helps out some people.
Last edited by LionsDen on Wed Jul 17, 2013 15:50, edited 1 time in total.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 5 guests

cron