DontCare
-
Posts
34 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by DontCare
-
-
Hey, few month ago I've found sh scrip for backups and bit modified it (usable only for linux/unix).
So here is a short tutorial:
1) Make next folders on your server:
/backup
/backup/metin2
2) Make file /backup/backup.sh and put in it next:
#!/bin/bash PROJNAME=metin2 CHARSET=utf8 DBNAME01=account DBNAME02=common DBNAME03=player DBFILENAME01=account DBFILENAME02=common DBFILENAME03=player HOST=localhost USER=db_user PASSWD="db_pass" DATADIR=/backup/metin2 SRCFILES=/home/game PREFIX=`date +%F` echo $PASSWD #start backup echo "[--------------------------------[`date +%F--%H-%M`]--------------------------------]" echo "[--START!--][`date +%F--%H-%M`] Run the backup script..." mkdir $DATADIR/$PREFIX 2> /dev/null echo "[+---------][`date +%F--%H-%M`] Generate a database backup..." #MySQL dump mysqldump --user=$USER --host=$HOST --password="$PASSWD" --default-character-set=$CHARSET $DBNAME01 > $DATADIR/$PREFIX/$DBFILENAME01-`date +%F-%H-%M`.sql mysqldump --user=$USER --host=$HOST --password="$PASSWD" --default-character-set=$CHARSET $DBNAME02 > $DATADIR/$PREFIX/$DBFILENAME02-`date +%F-%H-%M`.sql mysqldump --user=$USER --host=$HOST --password="$PASSWD" --default-character-set=$CHARSET $DBNAME03 > $DATADIR/$PREFIX/$DBFILENAME03-`date +%F-%H-%M`.sql if [[ $? -gt 0 ]];then echo "[----------][`date +%F--%H-%M`] Aborted. Generate database backup failed." exit 1 fi echo "[++--------][`date +%F--%H-%M`] Backup database - successfull." #Src dump echo "[+++-------][`date +%F--%H-%M`] Copy the source code project [$PROJNAME]..." tar -czpf $DATADIR/$PREFIX/$PROJNAME-`date +%F-%H-%M`.tar.gz $SRCFILES 2> /dev/null if [[ $? -gt 0 ]];then echo "[----------][`date +%F--%H-%M`] Aborted. Copying the source code failed." exit 1 fi echo "[++++------][`date +%F--%H-%M`] Copy the source code project successfull." echo "[+++++-----][`date +%F--%H-%M`] Prepare zip file $PROJNAME-$PREFIX.zip..." zip -r $DATADIR/$PROJNAME-$PREFIX.zip $DATADIR/$PREFIX if [[ $? -gt 0 ]];then echo "[----------][`date +%F--%H-%M`] Aborted. Make zip file failed." exit 1 fi echo "[++++++----][`date +%F--%H-%M`] Zip file $PROJNAME-$PREFIX.zip finished." echo "[+++++++---][`date +%F--%H-%M`] Remove folder." rm -rf $DATADIR/$PREFIX if [[ $? -gt 0 ]];then echo "[----------][`date +%F--%H-%M`] Remove folder failed." exit fi echo "[++++++++--][`date +%F--%H-%M`] Remove folder finished." echo "[+++++++++-][`date +%F--%H-%M`] Start datadir space (USED): `du -h $DATADIR | tail -n1`" echo "[++++++++++][`date +%F--%H-%M`] Free HDD space: `df -h /home|tail -n1|awk '{print $4}'`" echo "[+SUCCESS!+][`date +%F--%H-%M`] All operations completed successfully!" exit 0
3) And add this line into crontab. Backups will be created each morning at 6am.
0 6 * * * cd /backup/ && sh backup.sh
Regards.
Is this work on FreeBSD ? Thanks.
-
first make a mysql user then make a mysql database then import your sql
I tried it, but I couldn't do it. Can you help me ?
-
I dont know i just pick the quests that i need.
Okey. I will try to find main mission quests.
-
That is important because you need a place to save the information like the e-mail.
Okey. I understood you but I don't know how can I create a MySQL table on this website : http://cpanel.hostinger.web.tr/
-
Thanks but I don't have a MySQL. How can I solve this problem or it isn't important ?
-
I use some of the quests in here.
Which quests is the main quests ? I will choose main quests and then I will create my own serverfile.
-
Localhost can't send e-mail i think try on a free webhost.
Which free webhost ? Can you give me a website ?
-
-
-
-
Hi Metin2Dev members and admins. I have a little question for you about php. I work on localhost with AppServ. My script can't send a message such as register mail and lost password mail. How can I solve this problem ? Thanks. Have a nice day.
-
if (!(empty($_GET['s'])) || empty($_GET['w'])) { $p_name = "pages"; $v_name = "s"; } else { $p_name = "wiki"; $v_name = "w"; } $includeDir = ".". DIRECTORY_SEPARATOR .$p_name. DIRECTORY_SEPARATOR; $includeDefault = $includeDir . "home.php"; if (isset($_GET[$v_name]) && !empty($_GET[$v_name])) { $_GET[$v_name] = str_replace("0", '', $_GET[$v_name]); $includeFile = basename(realpath($includeDir . $_GET[$v_name] . ".php")); $includePath = $includeDir . $includeFile; if (!empty($includeFile) && file_exists($includePath)) { include ($includePath); } else { include ($includeDefault); } } else { include ($includeDefault); }
Thank you very much for you help. It is working very well.
-
Hi Metin2Dev members and admins. I tried to find automatic backup script but I couldn't find. Can you give me this script and quest ? Thanks.
-
-
I dont understand the problem?
My problems is I have a only "pages" folder, but I want to create a "wiki" folder and change the adress. For instance, from ?s=example to ?w=wikipages.
-
-
-
Hi. I tried to find Lycan items png but I couldn't find. Can anybody help me ? I will add to my item-shop. Thanks.
-
-
-
-
Hi Metin2Dev members and admins. I tried to find all official English quests but I couldn't find. Can you help me ? Thanks.
-
-
Register & Lostpw pages
in Community Support - Questions & Answers
Posted
Bump