GBall Creator (Automated Server Backup)
1 Attachment(s)
GBall Creator is a script to generate a "GBall package". This package can contain multiple files. Essentially, it works as a ZIP file but can be created serverside.
An example of why this is useful is that with one line of code you can backup a server's folder structure (selectively) — it can even be used to backup the accounts folder. PHP Code:
PHP Code:
The best part of the script is that it is optimized to work on populated servers. Initially the script will load all files needed into memory. This is the only part that will cause the server to lock up. After this, the files will be written every few minutes to evade the flood alert. There is protection so that if the flood alert kicks in and prevents a file from being written it will wait and then attempt to write it after the flood alert has subsided. This stage (file writing) can take hours, depending on the settings you specify at the top of the script, but it will not lag the server. Once the script has finished you will have files with a ".arc" extension. Download all of these files, then open the GBallExpander Java application included at the end of this post and select the first file. The application will expand the GBall files into the actual folder structure. This should not take long at all. You can also store the files in their GBall form and expand them later (you may wish to ZIP them to save file space). The Java application which expands the GBall files works fine on Mac and Windows, and probably any other system with the JRE installed. http://img535.imageshack.us/img535/5...09at41201a.png http://img717.imageshack.us/img717/9...09at41421a.png I should also mention that this script works fine to backup any type of file I've been able to throw at it, from text files to levels to images. Essentially you could backup the entire levels/* folder on your server. I used this on Era last night to backup the accounts folder and it worked flawlessly, so it should work just about anywhere. I feel like I've done a ****ty job explaining in this post, so feel free to ask questions. I haven't yet received permission to post a link to the source code for the Java application so forum PM me if you want it (or decompile the JAR). |
This would be very handy to have since Stefan stopped backing up playerworlds. Very nice. Rep++.
|
Should be sticky. :) Rep+.
|
now i have gballs all over my dekstop, thanks
|
Doesn't this involve having all the files you are putting in the GBall in memory at once? You should make it so it flushes the files in memory to the file every once in awhile (otherwise the machine will start swapping and slow down to a halt).
|
lol, players tackling problems cyberjoueurs should be doing in the first place. nice though :)
edit- sign your name in neg reps ffs |
Quote:
Granted, I can remove files which have been written already from the memory. I'll release a new version soon which does this (and a few other optimizations I've added). |
1 Attachment(s)
Releasing a new, much improved version. It now drops lines which have been written out of memory, which can be very important on populated servers. It also only checks the line count once, rather than before when it was checked each time a file was written (this was actually causing the most slowdown).
It also now provides better progress indications (such as the percent it is finished with writing) in echoes. PHP Code:
Example usage: PHP Code:
The source code for the expander (approved by Skyld) can be found here. (tip: combine this with Dylan's GraalCron for making daily NC backups) |
I'm a dumb dumb, so where do you put this code (wnpc? dbnpc?) and how to call the script to go? RC chat?
See? I r dumb dumb. |
Put it in a DB NPC and then just call the GBall function (see the examples in the first post). Make sure (npcserver) has read rights to the folders to backup and rw to the output folder.
|
Lol, I was typing it in rc for some reason. xD
Where does it save to? |
Quote:
PHP Code:
|
ah, thanks. :O
|
Im using this.
PHP Code:
|
Post the NPC-server rights?
|
All times are GMT +2. The time now is 10:43 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.