Server backup tool ?
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 42
- Joined: Sat Feb 02, 2008 11:44 pm
Server backup tool ?
Hello,
was wondering if there is any tool around that helps backing up server files/database ? like an automated schedueled one.
Thanks,
was wondering if there is any tool around that helps backing up server files/database ? like an automated schedueled one.
Thanks,
-
- Posts: 253
- Joined: Thu Apr 30, 2009 12:29 am
Re: Server backup tool ?
If you are using a Windows server then I have two suggestions for you:Menuval wrote:Hello,
was wondering if there is any tool around that helps backing up server files/database ? like an automated schedueled one.
Thanks,
1. Write up a simple batch file to dump the entire MySQL (L2JDB) database to a text file, then using Scheduled Task to set up automated backup.
2. Write up another simple batch file to copy the MySQL data folder from All User folder, then using Scheduled Task to setup up automated backup.
- janiii
- L2j Veteran
- Posts: 4269
- Joined: Wed May 28, 2008 3:15 pm
- Location: Slovakia
Re: Server backup tool ?
i have done this in the startGameServer.bat file, so that my server got backuped on each restart. just an idea.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
-
- Posts: 42
- Joined: Sat Feb 02, 2008 11:44 pm
Re: Server backup tool ?
using linux centos server ><
- janiii
- L2j Veteran
- Posts: 4269
- Joined: Wed May 28, 2008 3:15 pm
- Location: Slovakia
Re: Server backup tool ?
the same for the .sh script. only add sqldump to the restart part or wherever you want to do the backup.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
-
- Posts: 42
- Joined: Sat Feb 02, 2008 11:44 pm
Re: Server backup tool ?
can you give an example please?
- nonom
- L2j Veteran
- Posts: 649
- Joined: Wed Mar 11, 2009 10:34 pm
- Location: Magmeld
Re: Server backup tool ?
For example, each update I upload datapack and gameserver in separated files (.zip) using build.xml Ant task from Eclipse.
On live server, for example, we have a home user directory:
Well, we can use a couple of extra directories for deploy:
In /opt/ i usually have a build.sh that remove old files and backup important files, cron execute it each sunday. In /build/ directory i have my hexid.txt and some script.sql or properties to save (olys), my geodata/pathnode files, and more.
This is a simple bash script (custom) only an example:
build.sh
Now maybe will need to update some sql files, normally I like to do it manually
Well , now open your cron manager with
Add your build.sh and you can execute a similar batch script to backup and restore your files at 00:00 on Sunday.
Remember to give privs
Note: Its only an example, its means you need to have same files in same directories as my example , build a couple of extra dirs, and write a build.sh. This step-by-step script is only for learning purposes, isnt a production script but it can give you a idea 
You can add an automatic restart, update, package, all you need
Im using Debian Lenny 5.0+
On live server, for example, we have a home user directory:
Code: Select all
/home/l2jserver/
Code: Select all
/home/l2jserver/opt//home/l2jserver/build/
In /opt/ i usually have a build.sh that remove old files and backup important files, cron execute it each sunday. In /build/ directory i have my hexid.txt and some script.sql or properties to save (olys), my geodata/pathnode files, and more.
This is a simple bash script (custom) only an example:
build.sh
Code: Select all
#!/bin/sh # backup last logs files (maybe you need to check this later..)cp -rf /home/l2jserver/gameserver/log/ /home/l2jserver/opt/ # backup for olympiad.properties to restore it after updatecp -rf /home/l2jserver/gameserver/config/olympiad.properties /home/l2jserver/build/ # backup crests clans to restore it after updatecp -rf /home/l2jserver/gameserver/data/crests/ /home/l2jserver/opt/ # I have some modifications in LoginServer_loop.sh and i want to save this file also (optional for me)cp -rf /home/l2jserver/login/LoginServer_loop.sh /home/l2jserver/build/ # And.. all you need# -- here -- # Now,.. clean all filesrm -rf /home/l2jserver/gameserverrm -rf /home/l2jserver/libsrm -rf /home/l2jserver/languagesrm -rf /home/l2jserver/loginrm -rf /home/l2jserver/sqlrm -rf /home/l2jserver/toolsrm -rf /home/l2jserver/docrm -rf /home/l2jserver/imagesrm -rf /home/l2jserver/configrm -rf /home/l2jserver/*.txtrm -rf /home/l2jserver/*_lIC*rm -rf /home/l2jserver/*.html #Well.. now we can extract our updated server in same placeunzip -o -q /home/l2jserver/build/L2J_Server.zip -d ..unzip -o -q /home/l2jserver/build/L2J_DataPack.zip -d .. #We need to restore our important info (geodata included)cp -rf /home/l2jserver/build/geodata /home/l2jserver/gameserver/datacp -rf /home/l2jserver/build/pathnode /home/l2jserver/gameserver/datacp -rf /home/l2jserver/build/olympiad.properties /home/l2jserver/gameserver/configcp -rf /home/l2jserver/build/LoginServer_loop.sh /home/l2jserver/login/cp -rf /home/l2jserver/build/hexid.txt /home/l2jserver/gameserver/configcp -rf /home/l2jserver/build/chmod 750 /home/l2jserver/login/*.shchmod 750 /home/l2jserver/gameserver/*.sh # clean not important (for me) filesrm -rf /home/l2jserver/*.txtrm -rf /home/l2jserver/*_LIC*rm -rf /home/l2jserver/*.html # clean -_- windows files =Prm -rf /home/l2jserver/gameserver/*.batrm -rf /home/l2jserver/gameserver/*.exerm -rf /home/l2jserver/login/*.batrm -rf /home/l2jserver/login/*.exe # backup for mysql with dumpsmysqldump -u l2jserver -ppasswordhere --database yourdatabase > /home/l2jserver/opt/backup.sql #I have a empty script.sql.. to apply some sql scripts if is neccessary after updatemysql -u l2jserver -ppasswordhere --database yourdatabase < /home/l2jserver/opt/script.sql
Well , now open your cron manager with
Code: Select all
crontab -e
Code: Select all
0 0 * * 0 /home/l2jserver/opt/build.sh
Code: Select all
chmod 750 /home/l2jserver/opt/build.sh

You can add an automatic restart, update, package, all you need

Im using Debian Lenny 5.0+
-
- Posts: 286
- Joined: Fri Sep 22, 2006 1:03 am
- Location: Red Rock, Mars
Re: Server backup tool ?
I used Navicat to do scheduled backups automatically every 12 hours, I know SQL dumbs are fasters to restore but it's a lot easyer to just click a checkbox on the talbes you want to restore and not have to take the time to make a script to do it for you, I used a Windows XP Pro computer that was on the same LAN as the servers so I don't know if this would be a good idea to use over the Internet if your servers are hosted by someone else and not yourself.
-
- Posts: 253
- Joined: Thu Apr 30, 2009 12:29 am
Re: Server backup tool ?
The backup feature is only available on the paid versions of NaviCat but writing up a short scripts is an alternative to paying for the paid versions. In fact, the script I wrote took all but 5 minutes to write, then another 2 minutes to set up 2 backup per day using Scheduled Tasks.Deadmeat wrote:I used Navicat to do scheduled backups automatically every 12 hours, I know SQL dumbs are fasters to restore but it's a lot easyer to just click a checkbox on the talbes you want to restore and not have to take the time to make a script to do it for you, I used a Windows XP Pro computer that was on the same LAN as the servers so I don't know if this would be a good idea to use over the Internet if your servers are hosted by someone else and not yourself.
-
- Posts: 286
- Joined: Fri Sep 22, 2006 1:03 am
- Location: Red Rock, Mars
Re: Server backup tool ?
I had the paid version so why not use what I paid for but if your not looking to spend the money on Navicat then yeah it does not take long to backup and restore the whole database, little more work to restore one table but the post is about backing up the whole server in which case your way will work fine.