How do you guys backup your database ? Any good Cron Job Script for CPANEL ?

Discussion in 'Databases' started by coolrohit222002, Jun 26, 2012.

  1. #1
    Can anyone please share the script you use in backing up your database on phpmyadmin via cpanel using cron jobs. Any one who can share? Thanks.
     
    coolrohit222002, Jun 26, 2012 IP
  2. SolidShellSecurity

    SolidShellSecurity Banned

    Messages:
    262
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    45
    #2
    The way we do our client backups is from server to server. We have plans for a power shell script which will connect to the FTP server and download the backups to another local based location. So you could follow the same route but with a cron job that could backup all the sites.
     
    SolidShellSecurity, Jun 26, 2012 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    jestep, Jun 26, 2012 IP
  4. mikkola.antti

    mikkola.antti Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I backup it manually.
     
    mikkola.antti, Jun 26, 2012 IP
  5. inbargains

    inbargains Greenhorn

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #5
    Only use hosting that does backups and you don't need to worry. This is a lesson hard learned by many that search out cheap hosting. They wonder why they get hacked all the time, learn nobody did backups for them and wonder why their sites are slow. Invest in good hosting before beginning any online venture. It's the foundation for all your hard work.

    I learned this almost 9 years ago when I had to rebuild a website 3 times in 5 months. Now I run a hosting service (no pms please) and nobody on my servers get hacked, lose data or have slow websites. My inventory is on these same servers so they fall under my umbrella of security I invested in for my own websites.

    Get good hosting and forget about doing your own backups and such.
     
    inbargains, Jun 28, 2012 IP
  6. netload

    netload Member

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #6
    mysqldump -udb_user -pdb_pass -hdb_host --opt --add-drop-table --quote-name db_name > somename.sql
     
    netload, Jul 1, 2012 IP
  7. Alien44

    Alien44 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #7
    If your hosting company allows PHPmyAdmin, you can just click "Export" and save it to your computer.
     
    Alien44, Jul 2, 2012 IP
  8. extraspecial

    extraspecial Member

    Messages:
    788
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    45
    #8
    Database backup is easy with Cpanel just go to backups then click on the database it downloads immediately.

    But if you need to do it daily you may use a php backup script to backup and upload to a ftp or email to you, if you use wordpress there are plugins who do that.

    Plus most of the hosting companies do take backups daily so you really don't need to care.
     
    extraspecial, Jul 9, 2012 IP
  9. billvella

    billvella Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Listen, your hosting co should be doing this, but have you considered going a little further and backing up your valuable content on your personal pc,laptop? I just found this and it solved my problems and gave me access to my files anywhere anytime from my phone or any computer. http://track.mypcbackup.com/?hash=68daf8bd It is also an income opportunity.
     
    billvella, Jul 9, 2012 IP
  10. InnovusHost

    InnovusHost Peon

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you have access to crontabs, then you should be able to schedule a command with mysqldump. Wordpress also has some plugins that will do this for you.
     
    InnovusHost, Jul 9, 2012 IP
  11. samirj09

    samirj09 Well-Known Member

    Messages:
    335
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #11
    If you have root access the below should work,

    for i in `mysql -e "show databases" | awk '{print$1}' | egrep -v ^Database$ | grep -v information_schema`
    do
    echo dumping $i
    mysqldump $i > $i".sql"
    done
     
    samirj09, Jul 10, 2012 IP