Current location: Hot Scripts Forums » General Community » Script Requests » Linux Shell Mysql Backup Scripts


Linux Shell Mysql Backup Scripts

Reply
  #1 (permalink)  
Old 04-04-06, 11:08 AM
Pyromanci Pyromanci is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Linux Shell Mysql Backup Scripts

Ok, I have been trying to do this my self, but i guess my linux shell program isn't all that good.

Basicly what i am looking for is a simple linux script that goes through and runs a mysqldump on a configurable database and then repeats in 6 hours.

basicly our hosting providor says we have to maintian backups our selfs cuase they have around 300k customers each with 6+ database. We have 20 databases.

I have been looking for atleast a simple looping linux shell script but havn't been able to find one.

If any one can point me in the right direction or assist in correcting my current script that be great.
Reply With Quote
  #2 (permalink)  
Old 04-04-06, 12:23 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Use a cron job to run this type of command

mysqldump --host=SOURCE_SERVER -uSOURCE_USER -pSOURCE_PASS SOURCE_DB > databasedumpfile

You may want to add tar to reduce the dumpfile size.

If you don't have cron jobs, you may be able to use a different server or PC with wget to run a PHP script that executes the above.

Good luck
Reply With Quote
  #3 (permalink)  
Old 04-04-06, 12:36 PM
Pyromanci Pyromanci is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
The problem with that is our host only allows localhost server connection. Other wise i would have SQL Migration running to my local computer more then just ever 6 hours.

Aswell i do not have privs to setup a cron job of the hosting server.

Thats why i as goign to do it in the way linux shell scripts that loops through the commands then waits X amount of time before it repeated the loop.

I have done these sorta scripts before for MUD's, but this one just doesn't see to want to function with mysql.

Last edited by Pyromanci; 04-04-06 at 12:39 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Database Backup & Restore (PhP Script) KeYBLeR Script Requests 5 04-01-06 11:00 PM
mySQL backup amitroy5 PHP 1 01-08-06 06:57 AM
php and mysql scripts question pjacks PHP 4 03-25-05 01:09 PM
UPDATE: MySQL Auto Backup & Export v1.1 Beyonder General Advertisements 2 03-21-05 02:05 PM
PHP scripts unable to connect to DB after MySQL 4.1.10 upgrade Jason L PHP 3 03-08-05 12:32 AM


All times are GMT -5. The time now is 11:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.