Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Complete Backup Script

Newbie Spellweaver
May 5, 2009
Reaction score
This is a complete backup system for all files associatted with the PW server. The second part copies the files from the server to a remote location, you may erase that part if you don't want to copy these files across to another machine/drive. You may manually execute this or stick it in your crontab to have it run automatically. My full backup runs nightly and my gamedbd runs every 15 minutes. My server is set to save to the databases every 10 minutes, this ensures that in 1/2 hour I get 3 database saves in my backup.

Currently it is directed to /opt/pw-backup

Complete backup.


datestamp=`date +"%Y-%m-%d_%H-%M"`

tar zcvf /opt/pw-backup/pw-server-backup-$datestamp.tgz /server 

tar zcvf /opt/pw-backup/pw-web-backup-$datestamp.tgz /opt/jakarta-tomcat-5.5.9 /opt/lampp /opt/pw-scripts

tar zcvf /opt/pw-backup/pw-etc-backup-$datestamp.tgz /etc/ssl/private/client/world2_java_aumanager.keystore /etc/ssl/private/client/world2_java_gamemanager.keystore /etc/ssl/private/world2_ca.cer /etc/authd.conf /etc/gmopgen.xml /etc/GMserver.conf /etc/hosts /etc/iweb.conf /etc/table.xml /usr/libtask.so /usr/lib/libtask.so /lib/libpcre.so.0 /lib/libstdc++.so.5 

# now copy files over to the test server directory /opt/pw-backup-from-live-server
# a cron job there will stop the test server and move files then restart the server

tar zcvf /opt/pw-backup/pw-lampp-mysql-backup.tgz    /opt/lampp/var/mysql

scp      /opt/pw-backup/pw-lampp-mysql-backup.tgz    root@

tar zcvf /opt/pw-backup/pw-server-gamedbd-backup.tgz /server/gamedbd/dbhome /server/gamedbd/dbhomewdb /server/gamedbd/uniquenamed 

scp      /opt/pw-backup/pw-server-gamedbd-backup.tgz root@

Database only backup (MySQL AND the Gamedbd, my uniquenamed is in the same folder as my gamedbd databases, you may need to add your uniquenamed to ensure you grab this too)


datestamp=`date +"%Y-%m-%d_%H-%M"`

tar zcvf /opt/pw-backup/pw-server-gamedbd1-backup-$datestamp.tgz /server/gamedbd /opt/lampp/var/mysql

---------- Post added at 04:44 AM ---------- Previous post was at 03:53 AM ----------

SAY THANKS or I will delete ALL Of the files!