Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Posts
    516

    How to backup database (cpanel server)

    Hi,

    I have a crucial database (mysql).

    My server is running cpanel. It has daily backup but it is not enough as it is running a lot of transaction daily.

    I would like to run the backup to backup database only every 30 mins using cronjob. How do i do that in crontab. I have root access to the server.

    Thanks a lot

  2. #2
    Join Date
    Jul 2004
    Location
    Athens, Greece
    Posts
    203
    If you're worried for HDD failure, you may want to consider to use 2 similar HDDs with RAID-1 (mirroring). Even if the one fails, the data will remain to the other and you'll be able to replace the HDD and rebuild array.

    If you're generally worried about the database and you would prefer to back it up every 30 minutes, you may use mysqldump & crontab:
    mysqldump: http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
    crontab: http://www.adminschoice.com/docs/crontab.htm

    If you need any further information, don't hesitate to ask.

    Thank you.
    SharkTECH Internet Services
    http://www.sharktech.net
    DDOS Firewalled Dedicated Servers
    Managed Services / IRC Allowed

  3. #3
    Join Date
    Aug 2005
    Location
    Egypt
    Posts
    110
    mkdir /backup/mysql
    then
    chmod 0755 /backup/mysql
    then
    vi /scripts/mysqlbackup
    #!/bin/bash
    /usr/bin/rsync -arzgopu /var/lib/mysql /backup/mysql
    then
    :wq
    then
    chmod 755 /scripts/mysqlbackup
    echo "0 */6 * * * /scripts/mysqlbackup" >> /var/spool/cron/root

    this cron to take it every 6 hour u can change it if u have any issue just till me

    Regards Karem
    GNU/Linux system Engineer
    Contact Me: 00201003338749

  4. #4
    Join Date
    Jun 2002
    Posts
    1,376
    I haven't the slightest bit of experience doing it on cPanel, but if this database is absolutely mission-critical and you're backing it up very often, it may make sense to look into replication (if, of course, you have a spare server somewhere):

    http://dev.mysql.com/doc/refman/5.0/en/replication.html

    It's generally talked about in the context of distributing the load across multiple servers, but it can be used for backup purposes, too. With the ability to do 'asynchronous' syncing, you could keep a Linux box in your basement or something and just sync the two every 30 minutes (or more!).

    Again, I have no experience doing it on cPanel (and frankly, I doubt many people have?), but it seems like it could potentially be less cumbersome.

  5. #5
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    hbhb,

    You need a single database backup and each backup file as a separate dump file?
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Posting Permissions

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