Remote database back up script

Discussion in 'MySQL' started by MikeB67, Jun 23, 2009.

  1. #1
    Hi does anyone know of a good database back up script that will back up a database in either .zip or gzip and remotely upload it to a different server via FTP or another method? If you know of one thats good and secure let me know.

    Thanks!

    (I would be running this script daily as a cron, so would it be possible for the script to add the date to the filename?)
     
    MikeB67, Jun 23, 2009 IP
  2. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #2
    You can create yourself the script and you have several methods:

    scp with ssh keys, rsync or even mysqldump directly.
    The easiest method is to create a user (backup for example) with just select as privilege and run mysqldump from cron.daily. The script is something like:

    Don;t forget to allow mysqldump to connect to server from your remote location (grant select * to bakup@'yourip' identified by 'password').
     
    sacx13, Jun 23, 2009 IP
  3. MikeB67

    MikeB67 Member

    Messages:
    575
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    35
    #3
    I'm sorta confused by the post, mysqldump is installed when mysql is installed correct? Are there any pre made scripts for this or no? If there is can you link me to one?
     
    MikeB67, Jun 23, 2009 IP
  4. tuxicy

    tuxicy Member

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    tuxicy, Jun 24, 2009 IP
  5. MikeB67

    MikeB67 Member

    Messages:
    575
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    35
    #5
    I used to use that, it is my favorite importer but I find it to be way to much for a db back up that is ran every few hours.
     
    MikeB67, Jun 26, 2009 IP