Mac Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsMac Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 25th, 2007, 05:43 PM
skifast012 skifast012 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 31 skifast012 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 14 m 26 sec
Reputation Power: 2
MySQL Backup

Does anyone know of a application that runs on OS X that automatically backs up MySQL databases off of a schedule locally and on remote servers?

Reply With Quote
  #2  
Old March 25th, 2007, 08:12 PM
edman007's Avatar
edman007 edman007 is offline
Trapped on the forums...help
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Aug 2003
Location: /Users/edman007
Posts: 4,617 edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)  Folding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate Folder
Time spent in forums: 1 Month 3 Weeks 3 Days 4 h 34 m 24 sec
Reputation Power: 787
Send a message via AIM to edman007
mysqldump? just write a shell script to run a few mysqldump commands and put it on a cronjob, that should do everything you need
__________________
Feed ME

Reply With Quote
  #3  
Old March 25th, 2007, 11:56 PM
skifast012 skifast012 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 31 skifast012 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 14 m 26 sec
Reputation Power: 2
is there a gui application? If not can you assist me in doing what was suggested?

Reply With Quote
  #4  
Old March 26th, 2007, 12:25 PM
edman007's Avatar
edman007 edman007 is offline
Trapped on the forums...help
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Aug 2003
Location: /Users/edman007
Posts: 4,617 edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)  Folding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate Folder
Time spent in forums: 1 Month 3 Weeks 3 Days 4 h 34 m 24 sec
Reputation Power: 787
Send a message via AIM to edman007
i don't know of any GUI to do it, but i could help with doing it

first make a shell script to do the backup, something like this will do (its just a text file make it with whatever your want, but not TextEdit as that likes to save as RTF, something like TextMate will do), this file can have pretty much any name and should be saved somewhere that you can leave it and not delete it

you will need the terminal (/Applications/Utilities/Terminal) for a lot of this too

bash Code:
Original - bash Code
  1.  
  2. #!/bin/bash
  3. #this should include the location of your mysql install
  4. #which can be found by running "which mysqldump" in the terminal
  5. #if it returns something like /usr/local/bin/mysqldump then you should
  6. #add /usr/local/bin to the colon separated list below
  7. export PATH=/bin:/usr/bin:/usr/local/bin
  8. #this will dump the DB
  9. touch ~/.mysql_backup.gz
  10. chmod 700 ~/.mysql_backup.gz
  11. mysqldump -u root -pRootPassword --all-databases | gunzip -c > ~/.mysql_backup.gz
  12. #now a compressed backup is in your home folder (its hidden)
  13. #time to upload it to your FTP server
  14. #use curl because its pre-installed in OSX
  15. curl -u username:password -T ~/.mysql_backup.gz ftp://myserver.com/mysql-backup-`date +%F`.sql.gz > /dev/null
  16. #delete the local copy
  17. rm -f ~/.mysql_backup.gz


then open the terminal and its time to test it out
first chmod that file so it can be run, type this

Note: /path/to/script is the full filename of the script you just created, you can type it into the terminal by just dragging it into there when you need to type it

Note2: all commands in the terminal need to be run by hitting enter at the end

Code:
chmod 755 /path/to/script


now test it by typing in the filename and hitting enter, it should upload to the server, once you have confirmed that it works its time to make it run on a schedule

first get a copy of your crontab, run this

Code:
crontab -l > ~/Desktop/myCronTab.txt


now edit the file on your desktop, add a line that look like this

Code:
30 4 * * * /path/to/script


(note the syntax for the file can be found here, my example it will run nightly at 4:30 AM)

then save the file and add it to your crontab

Code:
crontab ~/Desktop/myCronTab.txt


and it should work, just make sure that you don't delete the script you made in the first place (the myCronTab.txt on your desktop can be deleted at the end)

also i didn't test the script i wrote above, but i believe it should work, if you have any problems just post back here

also with this method you username/password for mysql and your ftp server will show on the process list when the commands are running, if this is a shared server or people you don't trust have login rights to the computer you may want to edit the commands a bit which may require a bit more work (basically you need to save the passwords in config files or something and tell all programs that need it to read the file instead)

Last edited by edman007 : March 26th, 2007 at 12:29 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsMac Help > MySQL Backup


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway