Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th May 2009, 14:53
trexen trexen is offline
Senior Member
 
Join Date: Jun 2008
Location: Stockholm
Posts: 169
Thanks: 15
Thanked 3 Times in 2 Posts
Question MySQL backup

Hi,

I need a good MySQL script that logs in to mysql DB and reads out all DB to a txt file, that tha script goes in and make a backup on every DB it finds in that txt files.
This becase that users/customers delete/add DB during the day

Maybe someone already have a script like this and like to share?
i will do some research and get back with more information, feel free to help me =)

//M
Reply With Quote
Sponsored Links
  #2  
Old 7th May 2009, 22:39
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

you can try the script mentioned on http://www.howtoforge.com/rsync_incr...apshot_backups
Reply With Quote
  #3  
Old 8th May 2009, 01:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

http://www.howtoforge.com/how-to-bac...on-ubuntu-8.10
http://www.howtoforge.com/shell-scri...-to-remote-ftp
http://www.howtoforge.com/mysql-backups-with-zrm-2.0
http://www.howtoforge.com/back_up_my..._interruptions
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 8th May 2009, 14:11
choogendyk choogendyk is offline
Junior Member
 
Join Date: Apr 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you want real MySQL backup, and not to worry anymore, you should take a look at ZRM for MySQL (Zmanda Recovery Manager for MySQL). It is open source and also available with support contracts.

http://www.zmanda.com/backup-mysql.html
Reply With Quote
  #5  
Old 8th May 2009, 14:40
Jorem Jorem is offline
Senior Member
 
Join Date: Oct 2005
Posts: 139
Thanks: 5
Thanked 4 Times in 4 Posts
Default

Is you only have a few databases you can use the backup mysql function in Webmin. It writes the databases to .sql files or you can tar it.

I do the backup every hour on the server, en sync it to my home pc every day and weekly with SyncBack.
Reply With Quote
  #6  
Old 25th May 2009, 17:08
trexen trexen is offline
Senior Member
 
Join Date: Jun 2008
Location: Stockholm
Posts: 169
Thanks: 15
Thanked 3 Times in 2 Posts
Thumbs up Solution!

Hi
found the solution i was asking about earlier =)

make a mysql.sh that you need to logon to mysql shell:
/usr/bin/mysql -h localhost -u root -pYourePasswd < list.sh


And make list.sh and put:
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA INTO OUTFILE 'db-list';
then you can find it under "/var/lib/mysql/db-list"

My next part is to use the list i got whit all DB in my mysql server to make a individuel backup of all databases.
plz help =)

/regards
Marcus
Reply With Quote
  #7  
Old 25th May 2009, 19:10
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

if you use the script I mentioned in my previous reply you can backup every db without doing difficult things
Reply With Quote
  #8  
Old 25th May 2009, 22:57
trexen trexen is offline
Senior Member
 
Join Date: Jun 2008
Location: Stockholm
Posts: 169
Thanks: 15
Thanked 3 Times in 2 Posts
Thumbs up

just installed now, goint to try it tomorrow. thanks.
//M
Reply With Quote
  #9  
Old 26th May 2009, 01:52
madmucho madmucho is offline
Senior Member
 
Join Date: Oct 2006
Location: Czech republic, Karlovy Vary
Posts: 158
Thanks: 79
Thanked 11 Times in 11 Posts
Send a message via ICQ to madmucho
Default

I using this script, that is most simply backup script i ever find

MySQL Backup Script
# VER. 2.5 - http://sourceforge.net/projects/automysqlbackup/
just set root password
DBNAMES="all"
BACKUPDIR="/opt/mysql_backups"
MAILADDR="xxx@yy.cz"
put link into cron.daily and you have daily monthly weekly backup

backups can be send to remote ftp server.
Reply With Quote
  #10  
Old 27th May 2009, 21:35
trexen trexen is offline
Senior Member
 
Join Date: Jun 2008
Location: Stockholm
Posts: 169
Thanks: 15
Thanked 3 Times in 2 Posts
 
Smile

I made this one, works greate but i now need to backup induvidual DB so i dont need to restore all DB if one failed.

##### DB Backup #####
/usr/bin/mysqldump -h localhost -u root -pDBpasswd -c --add-drop-table --add-locks --all --quick --lock-tab
les --all-databases > /root/database/sqldump-`date +%Y%m%d`.sql

#### FTP to Backup Server ####
cd /root/database
HOST='192.168.250.10'
USER='ftpuser'
PASSWD='passwd'
ftp -n -v $HOST <<END
ascii
user $USER $PASSWD
prompt
mput *.sql
bye
END


It´s prety clear what this script does =)
//Marcus
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for an automatic backup for ISPConfig unsichtbare Installation/Configuration 1 2nd May 2008 14:33
Problem installing MySQL on suse 10.3 Txchaser Installation/Configuration 20 18th April 2008 01:05
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
Messed up ISPConfig-2.2.8 Upgrade Morons Installation/Configuration 4 29th November 2006 12:17
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04


All times are GMT +2. The time now is 09:41.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.