Results 1 to 9 of 9
  1. #1
    Join Date
    May 2005
    Location
    Canada
    Posts
    47

    Question How to automatically backup my MySQL databases

    Hi everyone,

    I've been searching around for the best way to automatically backup my databases. Basically I want my backup to be uploaded automatically onto another server/host.

    I have came across this script which is what exactly I'm looking for but I can't get it working...
    http://www.cyberciti.biz/tips/how-to...matically.html

    I keep getting the error below when I run it manually:
    /root/ncftpd-2.8.6/glibc2.5/ncftpd: illegal option i

    Can anyone recommend me a script that can automatically backup my database into another host or possibly figure out why I can't get the script working above?

    Thanks everyone

  2. #2
    Join Date
    Mar 2009
    Location
    Gods Own Country
    Posts
    681
    try using ncftpput command to upload to your server

    man ncftpput
    Fabin Mundattil @ Xieles Support
    High Quality Server Management | support @ xieles.com
    http://xieles.com

  3. #3
    You can use cron to backup your MySQL database automatically.
    Support Facility | 24/7 web hosting technical support services
    Technical support | Server management | Data migration

    Technical Articles

  4. #4
    Join Date
    Sep 2006
    Location
    Sheffield, UK
    Posts
    119
    I use cron to output the database, and then use wget from the remote server to fetch the sql file

  5. #5
    Join Date
    Sep 2007
    Posts
    368

    *

    Quote Originally Posted by ralphieb View Post
    Hi everyone,

    I've been searching around for the best way to automatically backup my databases. Basically I want my backup to be uploaded automatically onto another server/host.

    I have came across this script which is what exactly I'm looking for but I can't get it working...
    http://www.cyberciti.biz/tips/how-to...matically.html

    I keep getting the error below when I run it manually:
    /root/ncftpd-2.8.6/glibc2.5/ncftpd: illegal option i

    Can anyone recommend me a script that can automatically backup my database into another host or possibly figure out why I can't get the script working above?

    Thanks everyone
    You can upload your directory easily via same script, just need to tune.

    ncftp -u username -p password ftp.somedomain.com /destination-dir/ /source-file

  6. #6
    Join Date
    Apr 2002
    Location
    Auckland - New Zealand
    Posts
    1,572
    Or if you have mysql client tools available on the remote host, just use mysqldump with the -h flag to backup the remote database directly, skipping the need to ftp files around.

  7. #7
    Join Date
    May 2005
    Location
    Canada
    Posts
    47
    Thanks everyone for your replies. Just wanted to update this thread just in case someone else run into the same problem.

    After some more searching and testing I have came across this script http://blogama.org/node/63

    I'm currently running it on my server and it's working fine.

  8. #8
    Join Date
    Mar 2009
    Location
    Austin Tx
    Posts
    2,001
    mysqldump databasename > /backup/databasename.sql

    rsync -avz -e ssh /backup/ backuphost.domain.com:/backup

    cron them on the interval you need, use shared key so you don't need a password
    This is the best signature in the world....Tribute!
    (It is not the best signature in the world, no. This is just a tribute)

  9. #9
    Join Date
    Apr 2002
    Location
    Auckland - New Zealand
    Posts
    1,572
    Simpler solution

    [email protected]# mysqldump -h 123.123.123.123 -uUSER -pPASSWORD databasename > databasename.sql

Similar Threads

  1. mySQL Backup Multiple Databases?
    By SN-Matt in forum Hosting Security and Technology
    Replies: 10
    Last Post: 04-09-2012, 01:16 PM
  2. How to automatically check and repair mysql databases and tables?
    By smartcard in forum Hosting Security and Technology
    Replies: 9
    Last Post: 07-30-2009, 08:09 AM
  3. Backup and Restore Mysql databases.
    By hosseinrz in forum Hosting Security and Technology
    Replies: 0
    Last Post: 05-10-2008, 04:24 PM
  4. Automatically Backup MySQL
    By ThirstyGrunt in forum Programming Discussion
    Replies: 5
    Last Post: 05-25-2007, 02:34 PM
  5. Backup MySQL Databases by Cron
    By jhadley in forum Hosting Security and Technology Tutorials
    Replies: 2
    Last Post: 04-07-2007, 10:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •