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.

HELP! I need a Backup Script to Backup SQL Nightly... [moved]

Discussion in 'Data Protection' started by jeepj27, Sep 12, 2006.

  1. jeepj27

    jeepj27 Registered

    Joined:
    Sep 12, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Does anyone know of or can point me to a script that I can use as a Cron Job in CPANEL that will allow me to have a nightly backup of the entire SQL database emailed to me?


    Thanks to anyone!!

    -John
     
  2. kran

    kran Well-Known Member

    Joined:
    Jul 5, 2003
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Colombia
    cPanel Access Level:
    Root Administrator
  3. Chew

    Chew Well-Known Member

    Joined:
    Dec 31, 2003
    Messages:
    96
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Maryland
    it shouldn't be hard to write a cron job to dump the sql databases via the command line and use some lightweight command line ftp app to send it off.. or it doesn't even have to go anywhere.

    I used to have one...
    Let me see if I can dig it up.

    Chew
     
  4. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
  5. ujr

    ujr Well-Known Member

    Joined:
    Mar 19, 2004
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    16
    and this:

    "This script will allow you to maintain a database backup at any time interval you set. When you upload it to your server, you may set it up on a crontab and let it run daily, weekly or monthly. This script connects to your database, builds a backup "dump" file, gzip's it and either sends it to your email address or uploads it to an ftp server that you configured and cleans up the temporary files."

    http://www.phpfreaks.com/script/view/11.php
     
  6. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    If it is only nightly - why can you not simply copy from the Cpanel backup that was already made?

    /backup/cpbackup/daily/*/mysql

    Has all the mysql databases.

    You can rsync them or whatever.
     
  7. bmaworld

    bmaworld Registered

    Joined:
    Jul 12, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    try

    #!/usr/bin/expect -f



    set root_pass "123456789"

    set hostname "123.45.678.910"



    set folder "/backup/cpbackup/daily"



    spawn /usr/bin/scp -r $folder root@$hostname:/backup/servername/daily

    sleep 3

    expect "password: "

    sleep 3

    send "$root_passr"

    interact
     
  8. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider

    Bad idea. Never ever have your root password in plain text.
     
Loading...

Share This Page