The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

(s)ftp backup of just mysql dbs?

Discussion in 'General Discussion' started by spaceman, Dec 7, 2005.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Hello.

    I can see that remote ftp backup can be configured in WHM.

    My question: is it possible to ftp backup ONLY the mysql dbs to a remote location - preferably using secure ftp?

    I heard a horror story the other day from a local Australian guy who was (some time ago) hosting about 20 websites on behalf of his clients on a USA based dedicated server. The hosting company, without warning, closed down, stopped answering phone calls, so all data was effectively lost.

    The value of course is more in the data (mysql) and less in the website itself (which a good web developer will typically have the latest copy of on his/her local dev machine), hence my question specifically in relation to backing up all databases on a server to an offsite location (e.g. our own office).

    Any takers? I'm not at all adverse to spend a few hundred $$ (if that's what it takes) on purchasing and installing quality remote ftp backup software on my servers. But of course if the solution is simple and free... :)
     
  2. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    should be quite easy to do with cron jobs, you'll need to write yourself a script to dump all the mysql databases into a file and gzip it, then run a cron job on your local machine to scp the file down, Dependant on the size of your databases getting the timing right might take a little tweaking, e.g. if the mysql dump hasnt finished and your cron job runs you obviously wont have all the data, leaving an hour or so between the generation of the file and the scp cron job on your local machine should be adequate enough.
     
  3. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Fantastic! Thanks for your help.
     
  5. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    I'm running automysqlbackup - works very nicely to backup all mysql dbs to a designated directory on my remote server. (Point of interest: in looking at the zipped sizes of the dbs I noticed that one client on a 50Mb hosting account has a 178Mb mysql db! More research on these forums revealed that mysql dbs are NOT included in normal cpanel hosting quotas UNLESS you run /scripts/updatemysqlquota. Interesting!)

    My next question is: how do I ftp that directory (incl. or course all its contents) to another server / ftp location?

    Are there any standard scripts to do this (that I could run with a cron job)? Better still, the script would have some simple error reporting that would email me log and/or exception/error reporting.

    Here's hoping. :)
     
    #5 spaceman, Dec 8, 2005
    Last edited: Dec 8, 2005
  6. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
  7. aingaranweb

    aingaranweb Well-Known Member

    Joined:
    Mar 23, 2003
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    What do you specify to backup ALL mysql Databases?
     
  8. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    If you are referring to the backup script itself (automysqlbackup) - I think the default option is 'all dbs'.

    If you are referring to the rync process - we haven't implemented this yet (it's on the back burner due to higher priority tasks right now).
     
  9. aingaranweb

    aingaranweb Well-Known Member

    Joined:
    Mar 23, 2003
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    The backup script itself. I want to backup all the databases, but if i leave it blank.. Nothing's backed up.. If I set "all dbs" it's look for all & dbs
     
Loading...

Share This Page