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.

Backup takes too many resources

Discussion in 'Data Protection' started by optize, Mar 14, 2009.

  1. optize

    optize Well-Known Member

    Joined:
    Apr 27, 2005
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    I'm sure this has been an issue many times, however I'm trying to see what options we have here.

    We have 30+ cPanel boxes, and every night the cpu spikes for hours while it tars up the data, etc.

    What other methods are people using to backup their cPanel boxes, without making the box useless for hours?
     
  2. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    From what I can tell, rsync is one of the best options. We can backup one machine (500 approx accounts) in about 20-30 minutes (CPU utilisation is low on the source machine). You should still run the cPanel tarball backup every now and then though.

    I have an rsync-based script called cpmr which may help - it grabs a cPanel system in one lump. See the cpmr paragraph on www.whitedoggreenfrog.com/scripts/

    The other thing that may help is upgrading your boxes to the latest cPanel which supposedly has some speed improvements.
     
  3. pueblosnet

    pueblosnet Active Member

    Joined:
    Dec 23, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    hello brianoz! with rsync will be the mysql databases copied too? thanks.
     
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Yes, databases are copied too, if you use a script that copies /var/lib/mysql.

    If you want to absolutely guarantee database integrity, you should ensure mysql is shut down while you do the rsync.
     
  5. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    Yeah be very careful about only rsync'ing mysql. If you have a very active DB chances are decent it will become corrupt. It should be fine as long as the DB is not written to while the copy is being done. For smaller files the chance is less but for a large and active forum it becomes harder.

    Anyways yeah just be careful with rsync and mysql!
     
  6. ljesh

    ljesh Well-Known Member

    Joined:
    Aug 2, 2008
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    We make incremental backups from cpanel to the second drive and then rsync the second drive content to offsite server. Is this "dangerous" for mysql? :confused:
     
  7. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    No, the rsync won't hurt the live MySQL at all.

    The only problem comes if you are rsyncing the /var/lib/mysql directory (the dump files are fine) and a write happens to the file while doing the copy.

    You can rsync dumps just fine, or even the mysql dir while it is stopped. Rsync works fine most times but on a large DB with a busy site it will most likely end up corrupted if you rsync the dir itself.
     
Loading...

Share This Page