Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Last Chaos
You last visited: Today at 22:20

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] MySQL AutoBackup

Discussion on [Release] MySQL AutoBackup within the Last Chaos forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 241
Join Date: Dec 2011
Posts: 1,804
Received Thanks: 1,301
[Release] MySQL AutoBackup




Hallo,
nochmal ein kleines Release von mir.
Da hier einige Leute nicht wissen wie man die einfachsten Programme zur Datensicherung nutzt oder einfach zu faul sind sich damit zu beschäftigen hab ich mal rausgesucht was ich irgendwann mal geschrieben habe, damit evlt. die Spieler des Server's davon provitieren.

Es sichert alle Datenbanken im per Configfile festgelegten Intervall.
Angaben unter cycle sind in Minuten.
Für die jenigen die Probleme haben mit der Zeit ->

Ein Verkauf des Tools ist untersagt!
Updates werden hier nicht kommen.
€clips3 is offline  
Thanks
9 Users
Old 03/29/2014, 15:02   #2
 
Solution.?'s Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 1,101
Received Thanks: 1,273
Läuft, saubere Arbeit.
Solution.? is offline  
Thanks
2 Users
Old 03/29/2014, 15:11   #3
 
elite*gold: 241
Join Date: Dec 2011
Posts: 1,804
Received Thanks: 1,301
Quote:
Originally Posted by Solution.? View Post
Läuft, saubere Arbeit.
Danke
€clips3 is offline  
Thanks
1 User
Old 03/29/2014, 15:42   #4
 
PizzaGuy's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 435
Received Thanks: 480
Easier to setup a cron job in my opinion.

Edit "/etc/crontab"
Code:
30 2 * * * root mysqldump -u root -pPASSWORD --databases newproject_data newproject_db newproject_db_auth newproject_post | gzip > /home/user/database_`date +\%m-\%d-\%Y`.sql.gz
Make sure you change the database names and output directory to match yours.

Then restart your cron
Code:
/etc/init.d/cron restart
Now the OS will backup the database at 2:30 AM every day.
PizzaGuy is offline  
Thanks
5 Users
Old 03/29/2014, 15:59   #5
 
elite*gold: 241
Join Date: Dec 2011
Posts: 1,804
Received Thanks: 1,301
Quote:
Originally Posted by PizzaGuy View Post
Easier to setup a cron job in my opinion.
Sure.
€clips3 is offline  
Thanks
1 User
Old 03/29/2014, 16:04   #6
 
elite*gold: 265
Join Date: Jul 2009
Posts: 736
Received Thanks: 2,147
Warmonger is right.
And on windows you can do the exact same thing with Window Task Scheduler, using almost the same command.
Don't need a special program for that
Wizatek is offline  
Thanks
1 User
Old 03/29/2014, 18:58   #7

 
Chicken.ShooT's Avatar
 
elite*gold: 104
Join Date: Nov 2009
Posts: 5,227
Received Thanks: 2,805
Yes, easier for people who know how to set a cronjob.
We're using a script with LZMA(7zip)-Compression and SCP-Transfer to another server... backups are a lil bit useless on the same server.^^ Than you dont need a backup xD

For the "beginners" is good... don't forget to set a htaccess-File.
Chicken.ShooT is offline  
Thanks
1 User
Old 03/30/2014, 00:46   #8
 
elite*gold: 265
Join Date: Jul 2009
Posts: 736
Received Thanks: 2,147
In case of a hack attack, a SCP transfer might also nog be the right choice since you have your password, or private keys right there. I personally use a FTP server with only write access from that user, so not overwrite or delete. Like this u make sure that if someone entered your server that he can't reach the database backups.
Wizatek is offline  
Thanks
2 Users
Old 03/30/2014, 01:14   #9

 
Chicken.ShooT's Avatar
 
elite*gold: 104
Join Date: Nov 2009
Posts: 5,227
Received Thanks: 2,805
We have set a password on the archives AES-256.. but nothing is secure. FTP for example is unencrpted..
Chicken.ShooT is offline  
Old 03/30/2014, 11:59   #10
 
PizzaGuy's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 435
Received Thanks: 480
Quote:
Originally Posted by Chicken.ShooT View Post
We have set a password on the archives AES-256.. but nothing is secure. FTP for example is unencrpted..
Encrypting the backups serves no benefit, as the hacker would have root privileges on your server which already grants full database rights. I was able to take AIO database without even having access to the server. Short and sweet, backups are only intended so you don't lose anything. Otherwise there is no special/fancy way of keeping them. As long as you know they are somewhere you cannot lose them. The simplest way to do so is create a Cubby or Dropbox account solely for the server. And have it dump the databases to the synced folder. So the databases are automatically stored on the cloud the second they are dumped. And even better you can download the client to your home computer so it syncs to both the cloud and your personal computer.
PizzaGuy is offline  
Old 03/30/2014, 12:02   #11


 
MrTherzon's Avatar
 
elite*gold: 170
The Black Market: 179/0/1
Join Date: Dec 2012
Posts: 9,372
Received Thanks: 2,726
Nice Danke.
MrTherzon is offline  
Old 03/31/2014, 17:10   #12

 
Chicken.ShooT's Avatar
 
elite*gold: 104
Join Date: Nov 2009
Posts: 5,227
Received Thanks: 2,805
Quote:
Originally Posted by PizzaGuy View Post
Encrypting the backups serves no benefit, as the hacker would have root privileges on your server which already grants full database rights. I was able to take AIO database without even having access to the server. Short and sweet, backups are only intended so you don't lose anything. Otherwise there is no special/fancy way of keeping them. As long as you know they are somewhere you cannot lose them. The simplest way to do so is create a Cubby or Dropbox account solely for the server. And have it dump the databases to the synced folder. So the databases are automatically stored on the cloud the second they are dumped. And even better you can download the client to your home computer so it syncs to both the cloud and your personal computer.
Yes thats right, but when your server is hacked, than are the backups the least problem.^^ When the hacker have only access to the backupserver, than he must crack the archives, before he get the databases and other files, heavy task. The private key from backupserver is stored on the mainserver, not the other way.
Yes a cloud is better...^^ good argument.
Chicken.ShooT is offline  
Old 04/01/2014, 08:45   #13
 
elite*gold: 0
Join Date: Jan 2011
Posts: 330
Received Thanks: 220
Hi,

für einige sicher nützlich aber man braucht für Backups eigentlich kein Tool oder sonstiges...
Ein einfaches Script reicht da völlig aus, welches man im Screen laufen lässt...
(Beispiel: screen -a -S backup)...

Einfaches Beispiel für ein 30 Minuten Backup das sich jede Stunde überschreibt (backup.sh):

#!/bin/sh

mysqldump -u root -pxxxxx -r /pfad/zielverzeichnis/auth1.sql newproject_db_auth;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/user1.sql newproject_db_user;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/post1.sql newproject_post;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/db1.sql newproject_db;
sleep 1800;

mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/auth2.sql newproject_db_auth;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/user2.sql newproject_db_user;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/post2.sql newproject_post;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/db2.sql newproject_db;
sleep 1800;


mysqldump -u root -pxxxxx -r /pfad/zielverzeichnis/auth1.sql newproject_db_auth;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/user1.sql newproject_db_user;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/post1.sql newproject_post;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/db1.sql newproject_db;
sleep 1800;

mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/auth2.sql newproject_db_auth;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/user2.sql newproject_db_user;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/post2.sql newproject_post;
mysqldump -u root -pxxxxx -r /
pfad/zielverzeichnis/db2.sql newproject_db;
sleep 1800;

usw.

User, PW, Zielverzeichnis usw. kann jeder selbst anpassen, das dient nur als Beispiel...
Das kann man solange erweitern (auth3/auth4 usw.) und wiederholen oder als cronjob laufen lassen wie man will und man braucht kein "extra" Tool oder Software für sowas...
Die Backups werden in Folge angelegt und überschreiben sich auch wenn man es will...
Je nachdem, wie man es haben möchte...

Das nur nen einfaches dummes Beispiel von mir, wie jederman simple Autobackups anlegen könnte auch ohne "Tool" oder sonstiges...

Backups können bei Bedarf via SSH täglich vom Root runtergeladen werden...


PetraPokers is offline  
Old 04/01/2014, 15:19   #14
 
elite*gold: 22
Join Date: Feb 2012
Posts: 576
Received Thanks: 332
??
Warum den code x mal?
Entweder schleife oder besser per cronjob
VisionEP1 is offline  
Old 04/01/2014, 19:24   #15
 
elite*gold: 0
Join Date: Jan 2011
Posts: 330
Received Thanks: 220
Quote:
Originally Posted by VisionEP1 View Post
??
Warum den code x mal?
Entweder schleife oder besser per cronjob
Das war als Beispiel damit es jeder sieht und versteht wie einfach sowas ist und man kein Tool benötigt...
Natürlich braucht man die Dumps nur 1x wenn man das Scipt Endlos laufen lässt
Mein Beispiel zeigt nur, wie simple 4 Backups angelegt werden, wovon die letzten 2 die ersten 2 überschreiben...
Hätte ich es nur 1x gemacht, dann würden sich 90% fragen wie kommt der auf überschreiben oder was überhaupt ist ein cronjob...
Meisten haben nichtmal screen installiert oder wissen was das alles ist oO
Hätte auch noch hinzufügen können das man es mit killall backup.sh beenden muss...

Ich habe es auch oben geschrieben:

Einfaches Beispiel für ein 30 Minuten Backup das sich jede Stunde überschreibt (backup.sh):
"Das kann man solange erweitern (auth3/auth4 usw.) und wiederholen oder als cronjob laufen lassen wie man will"

Für solch Larifarikram und nem 4 Zeilenscript braucht man eigentlich kein Tool...
Aber ich verstehe den TE voll und ganz und finde es gut das er sowas für alle anbietet^^
Nicht jeder weiss wie man sowas macht...
Ich wollte nur hilfreich sein und zeigen wie einfach es ist um es selbst zu machen
Ein einfaches Textdokument reicht da völlig aus und nach oben ist noch sehr viel Luft, auch was packen der backups angeht usw...
Man braucht nur eine stumpfe Textdatei für alles und kein Tool... (so wie eigentlich immer)
Aber es ist ein positives Tool für LC und nicht eins was LC schadet, deshalb ist das eine super Sache mit dem Tool in meinen Augen und Danke an den TE...




PetraPokers is offline  
Reply


Similar Threads Similar Threads
[Release] Mysql - Firewall
09/24/2020 - Metin2 PServer Guides & Strategies - 16 Replies
Sooo, das erste mal das ich hier etwas release... ich werde KEIN How To machen, sondern nur sagen was möglich ist, und was es bringt! Mysql - Firewall Ich möchte euch hier GreenSQL zeigen. Es schützt euch vor Mysql-Injectionen und andere Datenbanken attacken.
[RELEASE] MySQL PHP Tester
02/27/2014 - Dekaron Private Server - 0 Replies
This script can test your mysql connection and check if you have mysql installed on php Just edit this file ("mysql_test.php") and upload to your server you want to check! Have fun, and DONT forget to say Thanks!
[Linux]Autobackup
11/11/2012 - General Coding - 0 Replies
Hey ihr lieben :) Ich habe eine Frage an euch bzw. eine Bitte: Mein Problem Server1 hat datein. Die sollen jede Stunde mit gzip -9 gepackt werden. Dann sollen die zip-datein auf Server2 hochgeladen werden und dann auf Server1 gelöscht werden. Dann soll bei Server1 nur bestimmte datenbanken in eine SQL gedumpt werden, diese SQL wieder in eine gzip -9 und dann auf Server2 hochgeladen werden und auf Server1 anschließen gelöscht werden. Wer kann mir da helfen, bzw. mir gute Tutorials...
[ASK FOR HELP]Did Anyoneone Have AutoBackup MYSQL
09/12/2010 - EO PServer Hosting - 2 Replies
HEllo i am trying to find any autobackup for mysql if someone have it could i ask for it for sharing please:handsdown:
[RELEASE]MySQL TableEditor
07/25/2009 - CO2 PServer Guides & Releases - 17 Replies
Hello e*pvper's! Here is my first C# tool. I have made this lite tool for people's who dont know how to use NativCat (or ther program's like this) For the initial release this tool have the next feature's: Connect To MySQL Server via IP,User and Password.* View and Edit table's. Alter Table's. Open Close DataBase's (DB's)



All times are GMT +2. The time now is 22:20.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.