MineAuto
Created by: Charles Broughton
Copyright (C) Shoujo Networks (2010)
MineAuto running on Windows 7 x86, having backed up a blank map...
This tiny program (12KB) allows you to keep a good hand on your MineCraft server, either locally or remotely via a built-in HTTP Web Server (for Remote Administration) that runs on a port of your choice*. It has loads of other features too:
[*:eo9hbf5t]MineAuto supports both saving backups to the DISK (either a networked drive, removable storage, or a fixed hard-drive) or having the backups uploaded to an FTP SERVER automatically.
[*:eo9hbf5t]Backups can be compressed in a number of formats, ZIP, RAR*, Bzip, LZMA, Gzip, or even UHMA*.
[*:eo9hbf5t]MineAuto automatically restarts your server if it crashes for ANY reason. It checks for a crash in a number of ways: either if the process is missing / not running; or if the process is using both no CPU and very little RAM*.
[*:eo9hbf5t]Server automatic restart and automatic backup are both optional things that can easily be enabled or disabled by editing the easy to edit MineAuto.ini configuration file, which displays fine in Notepad and nano.
Here are the many things you can customize in the MineAuto.ini file:
[*:eo9hbf5t]Where the server is (yes, MineAuto can be run from ANYWHERE).
[*:eo9hbf5t]The timezone that is used to time and date logs and backups.
[*:eo9hbf5t]If server restart monitoring is enabled or not.
[*:eo9hbf5t]How we restart the server (if need be).
[*:eo9hbf5t]How we tell if the server is down.
[*:eo9hbf5t]If server backups is enabled or not.
[*:eo9hbf5t]Where the backups are stored.
[*:eo9hbf5t]How backups are compressed.
[*:eo9hbf5t]How often server backups are taken.
[*:eo9hbf5t]Where MineAuto can put its temporary files.
[*:eo9hbf5t]If backups are stored on the DISK, or on an FTP SERVER, (or more).
[*:eo9hbf5t]If MineAuto is to log all console messages or not.*
MineAuto backing up a production map (screenshot during zipping)...
In future versions you will be able to do even more things with MineAuto, such as:
[*:eo9hbf5t]Have MineAuto store the backups on an email server (email them to you).
[*:eo9hbf5t]Have MineAuto store the backups in a MySQL or MySQLi database.
[*:eo9hbf5t]Backup the entire server, not just the maps. (optionally)
[*:eo9hbf5t]Make MineAuto optionally log all console messages to a file.
[*:eo9hbf5t]Make a config variable for the format of backup file names.
[*:eo9hbf5t]Make the server support more than just maps named "World".
[*:eo9hbf5t]Upload and download maps from other MineAuto users.**
[*:eo9hbf5t]MineAuto might have an installer soon, and come with the Alpha Server...***
* Means the feature is being worked on and not technically in the current release.
** You can opt-in or out of map sharing at any time, it is disabled by default.
*** I have to wait until Notch is off of vacation, to ask if this is alright.
MineAuto after being run for more than an hour... Proof that the application is stable enough to keep running...
FAQ
Q: How do I open these .zlib files?
A: Copy the file into your MineAuto folder, Run MineAuto_GZDeflate.bat, and follow the on-screen prompts.
Q: How do I use MineAuto?
A: Easy, download the file above and extract it into your MineCraft folder, or somewhere else even. ( I suggest the MineCraft folder (minecraft_folder/MineAuto) because that is all I've tested in depth so far. )
Q: How do I report bugs?
A: Reply to this thread with the bugs you see. Same goes for suggestions.
Q: OMG IT DOESN'T WORK
A: Even thought this isn't a question, try installing PHP (from PHP.net) http://windows.php.net/downloads/releas ... C9-x86.msi Just install it to C:/Program Files/PHP and say "Do not setup a webserver".
Q: Why does it say it's zipping more files than it copied?
A: Each sub-directory is also an entry in the zip. So that X of Y is based on folders AND files.
Q: YOU ****ER, YOU MADE ME LOSE MY MAPS (or some other complaint
A: Please re-read LICENSE. (opens in notepad, and at first run). READ IT. Even though this should never happen (ever), I can't be held liable if it does.
Q: Can I use MineAuto with my program(s), like... redistribute it?
A: Again, please read LICENSE. I don't mind if you redistribute it, but be sure to read and follow the terms and conditions that I layed out in LICENSE. Then you are free to redistribute MineAuto all you want.
Q: My question wasn't in this FAQ, what do I do?
A: Just reply with your question below.
Q: BLARGH IMMA STEAL YOUR ****
A: Orly? Also not a question. If people want to steal my code and give no credit, then I may not bother working on this, and be an ass like a certain private server software that doesn't release to the public anymore because of this exact same reason.
v0.1.0.1:[*:2whgyxuf]First release, supported DISK, and as buggy as hell. Restart wasn't working.
v0.1.0.2:[*:2whgyxuf]First PUBLIC release. Fixed bugs, fixed restart, added FTP.
v0.1.0.3:[*:2whgyxuf]Adjusted zip timing, resulting in much faster file zipping. (1.7x speed)
[*:2whgyxuf]Restart now starts the server with a nicer name... (Temp -> Minecraft Alpha Server)
[*:2whgyxuf]Created more error messages (more catches too). IE: You'll know why X doesn't work.
[*:2whgyxuf]Decreased cycling time (speeds up "checking server" stage by 1.4x (approx).
[*:2whgyxuf]Removed two extra conditional calls.
[*:2whgyxuf]Rephrased "Server crashed or not found."
[*:2whgyxuf]Archive mapping of "1" is now correctly "World".
[*:2whgyxuf]Rephrased "Backup: Clearing Temp..."
[*:2whgyxuf]Corrected backup mistiming (32.5min == 30min); Caused due to a late $lastbackup set.
[*:2whgyxuf]If FTP connection fails, MineAuto now falls back to DISK.
[*:2whgyxuf]New ZLIB Compression
v0.1.0.4:[*:2whgyxuf]Adjusted zip timing again. Minimal result. (better asthetics).
[*:2whgyxuf]Added temporary directory cleanup, to prevent conflicting archive names.
[*:2whgyxuf]Replaced all RD and del calls with builtin unlink and new super_unlink.
[*:2whgyxuf]Replaced archaic fileIO methods with one-stop file_get_contents.
[*:2whgyxuf]Enforced reading of the license file.
[*:2whgyxuf]New BZ2 Compression
[*:2whgyxuf]New LZMA Compression
[*:2whgyxuf]Now cleans up after itself (in the TEMP directory).
[*:2whgyxuf]Option to save to DISK & FTP all in one pass.
v0.1.0.5:[*:2whgyxuf]New GZDeflate program (to open .zlib files)
[*:2whgyxuf]Ability to save to DISK and FTP at the same time.
[*:2whgyxuf]Various small fallbacks and error checking.
[*:2whgyxuf]Fixed filsize bug in the Zip function, optimised Zip function.
[*:2whgyxuf]Displays debug information about FTP connections now.
Wanted to load back up a save from about 10 mins ago. deleted my world that was messed up (friend jacked up our base screwing around with lava), and was greeted by a world that was from about more than an hour ago. all of the saves were like this.
I had them saving in 10 minute intervals (we've been working quite quickly, making different things).
Maybe the program is zipping old states saved over and over again, instead of zippnig the newest save? I don't know.
It zips the latest save, but since the Minecraft server only writes to the save every so often... I can't make that any faster. Minimum interval you should expect to work is every 30mins.
v0.1.0.4:[*:2uthqt3k]Adjusted zip timing again. Minimal result. (better asthetics).
[*:2uthqt3k]Added temporary directory cleanup, to prevent conflicting archive names.
[*:2uthqt3k]Replaced all RD and del calls with builtin unlink and new super_unlink.
[*:2uthqt3k]Replaced archaic fileIO methods with one-stop file_get_contents.
[*:2uthqt3k]Enforced reading of the license file.
[*:2uthqt3k]New BZ2 Compression
[*:2uthqt3k]New LZMA Compression
[*:2uthqt3k]Now cleans up after itself (in the TEMP directory).
[*:2uthqt3k]Option to save to DISK & FTP all in one pass.
Thanks for the response. Do you know of any way to have the server save more often (short of doing it manually)?
My buddy and I are constantly building enormous structures and other projects that move at a very fast pace, creating the need for frequent saves and backups.
Unfortunately since the server.properties file offers little to no customisation of the server itself I can only suggest /save-all very often from inside the game, or save-all often in the console. That's the only way I know.
I am worknig on de-compiling the minecraft-server.jar to see if it IS customisable, via a command line or startup parameter.
a(str2, "Forcing save..");
this.e.a(true, null);
this.e.a points to...
public ec e;
ec points to and contains these matches...
private bl A = new bl(15, as.class, new Class[] { ci.class, gs.class, ax.class, hg.class });
protected bi a(File paramFile) {}
Yeah... code obfuscation... *sadfaic* Alright so, not possible. In the server startup section, it doesn't even read admin-slot out of the server.properties file (another sadface). The minecraft server is... :/ I wish he'd just release the source already.
What's the harm in releasing the server source anywho?
It's not a great solution Charles, but in my backup utility I used a windows VBS script to call the console window and then manually enter save-all . It's a bandaid and requires the window to be named properly or for the vbs script to be changed depending on the console window name, but it works well. I have no problems with it on my home server.
You're free to use it if you think it might be worth implementing.
'VBS Script to force Minecraft Server to save all
'By Dateranoth - August 28, 2010
'v1.0 - Initial Release
'v1.1 - Added lines to bring window into focus before key strokes.
Set WshShell = WScript.CreateObject("WScript.Shell")
'Enter the name of your Server Window Here bewteen the apostrophies
T1 = "Minecraft Server"
Sub KeyIt(Keystroke, WinTitle)
WshShell.AppActivate WinTitle
WScript.Sleep 100
WshShell.SendKeys Keystroke
End Sub
WshShell.AppActivate WinTitle
Call KeyIt( "{ENTER}", T1)
Call KeyIt( "(s)", T1)
Call KeyIt( "(a)", T1)
Call KeyIt( "(v)", T1)
Call KeyIt( "(e)", T1)
Call KeyIt( "(-)", T1)
Call KeyIt( "(a)", T1)
Call KeyIt( "(l)", T1)
Call KeyIt( "(l)", T1)
Call KeyIt( "{ENTER}", T1)
Wscript.Quit
Rollback Post to RevisionRollBack
MC AutoBackup:
Forces server auto-save, incremental backup options,Cartograph, and Overviewer options with ftp upload of Overviewer for your Minecraft Server.
ZLIB files are opened using any GZ decoder. These are GZIPPED information (such as how your browser retreives GZipped webpages from the server to conserve bandwidth and stuff). I'll include a GZIP decoder in v0.1.0.5.
Your vbscript might work... but I'll have to make a loop that searches for the minecraft window title (and implement your vbscript inside PHP, without actually calling vbscript).
By the way, my server software works on Linux just fine (if you all didn't know yet).
Doesn't seem to be working with the new update. Gets stuck on backing up.
Please check the titlebar of the application and tell me what it says. As well it would help if you posted to me the recent bits of the command log. (what you see in the window)
It's not a great solution Charles, but in my backup utility I used a windows VBS script to call the console window and then manually enter save-all . It's a bandaid and requires the window to be named properly or for the vbs script to be changed depending on the console window name, but it works well. I have no problems with it on my home server.
Right so, I found out it's actually impossible to find a program from its window title. I can find programs processes, but I can't find what is what, also I can't send keys to a process name :sad.gif:. It's actually impossible.
I hate vbscript, and the entire wscripting host. It's literally impossible, says MANY sites on Google :sad.gif:.
--
Looks like no send keys is possible...
I went through a few tries, and found out it's completely impossible.
Option Explicit
Dim objWMIService, objProcess, colProcess, strList, WshShell
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & ".\root\cimv2")
Set colProcess = objWMIService.ExecQuery( _
"Select * from Win32_Process" _
& " WHERE Name = 'java.exe'" _
& " OR Name = 'javaw.exe'" _
& " OR Name = 'minecraft_server.exe'")
For Each objProcess in colProcess
strList = objProcess.Handle
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim JSYS, count, winList, a, i, sInfo
;-- Set JSYS = CreateObject("jssys3.ops")
;-- count = JSYS.getopenwindowtitles(a)
sInfo = ""
For i = 0 to ubound(a)
sInfo = sInfo & vbCrLf & a(i)
Next
WScript.echo sInfo
Next
WSCript.Echo strList
WScript.Quit
Execution complete. MineAuto crashed.
Crash on (Sat 09/11/2010) @ (15:32:57.90).
The title bar says iterating files.
Also in the zip file it starts to make it has a c: folder then inside that a windows folder then temp inside that.
These are in the php-errors log:
[11-Sep-2010 06:40:41] PHP Notice: Undefined variable: fileNum in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 52
[11-Sep-2010 06:40:41] PHP Notice: Undefined variable: t in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 63
[11-Sep-2010 06:40:41] PHP Notice: Undefined variable: t in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 67
[11-Sep-2010 06:40:41] PHP Fatal error: Call to undefined function filsize() in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 60
v0.1.0.5:[*:25q05siq]New GZDeflate program (to open .zlib files)
[*:25q05siq]Ability to save to DISK and FTP at the same time.
[*:25q05siq]Various small fallbacks and error checking.
[*:25q05siq]Fixed filsize bug in the Zip function, optimised Zip function.
[*:25q05siq]Displays debug information about FTP connections now.
Created by: Charles Broughton
Copyright (C) Shoujo Networks (2010)
MineAuto running on Windows 7 x86, having backed up a blank map...
This tiny program (12KB) allows you to keep a good hand on your MineCraft server, either locally or remotely via a built-in HTTP Web Server (for Remote Administration) that runs on a port of your choice*. It has loads of other features too:
[*:eo9hbf5t]MineAuto supports both saving backups to the DISK (either a networked drive, removable storage, or a fixed hard-drive) or having the backups uploaded to an FTP SERVER automatically.
[*:eo9hbf5t]Backups can be compressed in a number of formats, ZIP, RAR*, Bzip, LZMA, Gzip, or even UHMA*.
[*:eo9hbf5t]MineAuto automatically restarts your server if it crashes for ANY reason. It checks for a crash in a number of ways: either if the process is missing / not running; or if the process is using both no CPU and very little RAM*.
[*:eo9hbf5t]Server automatic restart and automatic backup are both optional things that can easily be enabled or disabled by editing the easy to edit MineAuto.ini configuration file, which displays fine in Notepad and nano.
Here are the many things you can customize in the MineAuto.ini file:
[*:eo9hbf5t]Where the server is (yes, MineAuto can be run from ANYWHERE).
[*:eo9hbf5t]The timezone that is used to time and date logs and backups.
[*:eo9hbf5t]If server restart monitoring is enabled or not.
[*:eo9hbf5t]How we restart the server (if need be).
[*:eo9hbf5t]How we tell if the server is down.
[*:eo9hbf5t]If server backups is enabled or not.
[*:eo9hbf5t]Where the backups are stored.
[*:eo9hbf5t]How backups are compressed.
[*:eo9hbf5t]How often server backups are taken.
[*:eo9hbf5t]Where MineAuto can put its temporary files.
[*:eo9hbf5t]If backups are stored on the DISK, or on an FTP SERVER, (or more).
[*:eo9hbf5t]If MineAuto is to log all console messages or not.*
MineAuto backing up a production map (screenshot during zipping)...
In future versions you will be able to do even more things with MineAuto, such as:
[*:eo9hbf5t]Have MineAuto store the backups on an email server (email them to you).
[*:eo9hbf5t]Have MineAuto store the backups in a MySQL or MySQLi database.
[*:eo9hbf5t]Backup the entire server, not just the maps. (optionally)
[*:eo9hbf5t]Make MineAuto optionally log all console messages to a file.
[*:eo9hbf5t]Make a config variable for the format of backup file names.
[*:eo9hbf5t]Make the server support more than just maps named "World".
[*:eo9hbf5t]Upload and download maps from other MineAuto users.**
[*:eo9hbf5t]MineAuto might have an installer soon, and come with the Alpha Server...***
* Means the feature is being worked on and not technically in the current release.
** You can opt-in or out of map sharing at any time, it is disabled by default.
*** I have to wait until Notch is off of vacation, to ask if this is alright.
--
Download: Version 0.1.0.5: http://www.project-ddl.org/MineAuto_v0.1.0.5.zip
Password: CharlesBroughton
Proof that the application is stable enough to keep running...
FAQ
Q: How do I open these .zlib files?
A: Copy the file into your MineAuto folder, Run MineAuto_GZDeflate.bat, and follow the on-screen prompts.
Q: How do I use MineAuto?
A: Easy, download the file above and extract it into your MineCraft folder, or somewhere else even. ( I suggest the MineCraft folder (minecraft_folder/MineAuto) because that is all I've tested in depth so far. )
Q: How do I report bugs?
A: Reply to this thread with the bugs you see. Same goes for suggestions.
Q: OMG IT DOESN'T WORK
A: Even thought this isn't a question, try installing PHP (from PHP.net) http://windows.php.net/downloads/releas ... C9-x86.msi Just install it to C:/Program Files/PHP and say "Do not setup a webserver".
Q: Why does it say it's zipping more files than it copied?
A: Each sub-directory is also an entry in the zip. So that X of Y is based on folders AND files.
Q: YOU ****ER, YOU MADE ME LOSE MY MAPS (or some other complaint
A: Please re-read LICENSE. (opens in notepad, and at first run). READ IT. Even though this should never happen (ever), I can't be held liable if it does.
Q: Can I use MineAuto with my program(s), like... redistribute it?
A: Again, please read LICENSE. I don't mind if you redistribute it, but be sure to read and follow the terms and conditions that I layed out in LICENSE. Then you are free to redistribute MineAuto all you want.
Q: My question wasn't in this FAQ, what do I do?
A: Just reply with your question below.
Q: BLARGH IMMA STEAL YOUR ****
A: Orly? Also not a question. If people want to steal my code and give no credit, then I may not bother working on this, and be an ass like a certain private server software that doesn't release to the public anymore because of this exact same reason.
v0.1.0.1:[*:2whgyxuf]First release, supported DISK, and as buggy as hell. Restart wasn't working.
v0.1.0.2:[*:2whgyxuf]First PUBLIC release. Fixed bugs, fixed restart, added FTP.
v0.1.0.3:[*:2whgyxuf]Adjusted zip timing, resulting in much faster file zipping. (1.7x speed)
[*:2whgyxuf]Restart now starts the server with a nicer name... (Temp -> Minecraft Alpha Server)
[*:2whgyxuf]Created more error messages (more catches too). IE: You'll know why X doesn't work.
[*:2whgyxuf]Decreased cycling time (speeds up "checking server" stage by 1.4x (approx).
[*:2whgyxuf]Removed two extra conditional calls.
[*:2whgyxuf]Rephrased "Server crashed or not found."
[*:2whgyxuf]Archive mapping of "1" is now correctly "World".
[*:2whgyxuf]Rephrased "Backup: Clearing Temp..."
[*:2whgyxuf]Corrected backup mistiming (32.5min == 30min); Caused due to a late $lastbackup set.
[*:2whgyxuf]If FTP connection fails, MineAuto now falls back to DISK.
[*:2whgyxuf]New ZLIB Compression
v0.1.0.4:[*:2whgyxuf]Adjusted zip timing again. Minimal result. (better asthetics).
[*:2whgyxuf]Added temporary directory cleanup, to prevent conflicting archive names.
[*:2whgyxuf]Replaced all RD and del calls with builtin unlink and new super_unlink.
[*:2whgyxuf]Replaced archaic fileIO methods with one-stop file_get_contents.
[*:2whgyxuf]Enforced reading of the license file.
[*:2whgyxuf]New BZ2 Compression
[*:2whgyxuf]New LZMA Compression
[*:2whgyxuf]Now cleans up after itself (in the TEMP directory).
[*:2whgyxuf]Option to save to DISK & FTP all in one pass.
v0.1.0.5:[*:2whgyxuf]New GZDeflate program (to open .zlib files)
[*:2whgyxuf]Ability to save to DISK and FTP at the same time.
[*:2whgyxuf]Various small fallbacks and error checking.
[*:2whgyxuf]Fixed filsize bug in the Zip function, optimised Zip function.
[*:2whgyxuf]Displays debug information about FTP connections now.
Need I say more? Saved 0.5MB over 7.5MB, only only took 2 seconds longer.
Wanted to load back up a save from about 10 mins ago. deleted my world that was messed up (friend jacked up our base screwing around with lava), and was greeted by a world that was from about more than an hour ago. all of the saves were like this.
I had them saving in 10 minute intervals (we've been working quite quickly, making different things).
Maybe the program is zipping old states saved over and over again, instead of zippnig the newest save? I don't know.
Uploaded v0.1.0.4
My buddy and I are constantly building enormous structures and other projects that move at a very fast pace, creating the need for frequent saves and backups.
I am worknig on de-compiling the minecraft-server.jar to see if it IS customisable, via a command line or startup parameter.
a(str2, "Forcing save..");
this.e.a(true, null);
this.e.a points to...
public ec e;
ec points to and contains these matches...
private bl A = new bl(15, as.class, new Class[] { ci.class, gs.class, ax.class, hg.class });
protected bi a(File paramFile) {}
Yeah... code obfuscation... *sadfaic* Alright so, not possible. In the server startup section, it doesn't even read admin-slot out of the server.properties file (another sadface). The minecraft server is... :/ I wish he'd just release the source already.
What's the harm in releasing the server source anywho?
You're free to use it if you think it might be worth implementing.
viewtopic.php?f=10&t=29377
Forces server auto-save, incremental backup options,Cartograph, and Overviewer options with ftp upload of Overviewer for your Minecraft Server.
Visit Gamercide.org
Your vbscript might work... but I'll have to make a loop that searches for the minecraft window title (and implement your vbscript inside PHP, without actually calling vbscript).
By the way, my server software works on Linux just fine (if you all didn't know yet).
Please check the titlebar of the application and tell me what it says. As well it would help if you posted to me the recent bits of the command log. (what you see in the window)
Right so, I found out it's actually impossible to find a program from its window title. I can find programs processes, but I can't find what is what, also I can't send keys to a process name :sad.gif:. It's actually impossible.
I hate vbscript, and the entire wscripting host. It's literally impossible, says MANY sites on Google :sad.gif:.
--
Looks like no send keys is possible...
I went through a few tries, and found out it's completely impossible.
[06]: Backup: Copying Current State... 2224 File(s) copied
[06]: Backup: Creating ZIP...
Execution complete. MineAuto crashed.
Crash on (Sat 09/11/2010) @ (15:32:57.90).
The title bar says iterating files.
Also in the zip file it starts to make it has a c: folder then inside that a windows folder then temp inside that.
These are in the php-errors log:
[11-Sep-2010 06:40:41] PHP Notice: Undefined variable: fileNum in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 52
[11-Sep-2010 06:40:41] PHP Notice: Undefined variable: t in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 63
[11-Sep-2010 06:40:41] PHP Notice: Undefined variable: t in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 67
[11-Sep-2010 06:40:41] PHP Fatal error: Call to undefined function filsize() in C:\Users\Administrator\Desktop\backupmc\MineAuto.php on line 60
Uploaded v0.1.0.5, with GZDeflate.
Please re-download, the zip should be 356.04 KB.