[Script] Automatic backup bases
#1

In total hello,
In general the purpose of a script such is to do ôðüÿ all bases at:
1) Emergency server shutdown at DOS attacks!
2) At server reset!
3) At full of a server stop Devom!
 
As a whole the script will be useful to much, BUT NOT the Script checked

 

#!/bin/sh

DBHOST=localhost
USER=
PASS=
DBNAME_1=newproject_data
DBNAME_2=newproject_db
DBNAME_3=newproject_db_auth

while :;
do
mysqlcheck -h $DBHOST -u $USER --password=$PASS -s -r $DBNAME_1>>"log/`date +%Y-%m-%d_%H:%M:%S`-sql_newproject_data.log"
mysqlcheck -h $DBHOST -u $USER --password=$PASS -s -r $DBNAME_2>>"log/`date +%Y-%m-%d_%H:%M:%S`-sql_newproject_db.log"
mysqlcheck -h $DBHOST -u $USER --password=$PASS -s -r $DBNAME_3>>"log/`date +%Y-%m-%d_%H:%M:%S`-sql_newproject_db_auth.log"
mysqldump -h $DBHOST -u $USER --password=$PASS $DBNAME_1 | gzip > "backup/`date +%Y-%m-%d_%H:%M:%S`-"$DBNAME"_newproject_data.gz"
mysqldump -h $DBHOST -u $USER --password=$PASS $DBNAME_2 | gzip > "backup/`date +%Y-%m-%d_%H:%M:%S`-"$DBNAME"_newproject_db.gz"
mysqldump -h $DBHOST -u $USER --password=$PASS $DBNAME_3 | gzip > "backup/`date +%Y-%m-%d_%H:%M:%S`-"$DBNAME"_newproject_db_auth.gz"

cd Connector/Connector;
./start;
sleep 5;

cd ../../;
cd Helper/Helper;
./start;
sleep 5;

cd ../../;
cd SubHelper/SubHelper;
./start;
sleep 5;

cd ../../;
cd Messenger/Messenger;
./start;
sleep 5;

cd ../../;
cd GameServer;

cd GameServer1;
./start2;
cd ..;

cd GameServer2;
./start2;
cd ..;

cd GameServer3;
./start2;
cd ..;

cd GameServer4;
./start2;
cd ..;

cd GameServer5;
./start2;

cd ../../;
cd LoginServer/LoginServer;
./start;

[ $? -ne 2 ] && break
sleep 30;
done

 

 

! ! ! IMPORTANT! ! !

In the root folder of the server we create folders with the name log and backup for this purpose to leave information about backup and the arisen mistakes at Tampa.
 
The folder - log = Serves for the reporting about backup
The folder - backup = Serves for preservation backup
 
I hope a script it will be useful to you, from you a magic button like with you there was your Warface


Messages In This Thread
[No subject] - by ☣ WARFACE ☣ - 05-06-2013, 07:18 PM
[No subject] - by Douglas Farias - 05-31-2013, 04:11 AM
[No subject] - by Creep - 05-31-2013, 11:02 AM
[No subject] - by Wizatek - 06-01-2013, 01:52 AM
[No subject] - by halohalo - 06-01-2013, 03:55 AM
[No subject] - by Canton - 06-01-2013, 09:27 AM
[No subject] - by Creep - 06-01-2013, 09:55 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)