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 Issues: whm or rsync dont do incremental plus mysql dump questions

Discussion in 'General Discussion' started by vladgur, Mar 17, 2008.

  1. vladgur

    vladgur Member

    Joined:
    Apr 18, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Hey guys, here is a little background into my issue:
    I do daily backup to second hard drive and then perform rsync to my bqbackup.com

    Every night at 1am, WHM performes the incremental backup of all server databases and only ONE (very important) account to a second hard drive at /mnt/hd2/cpbackup/
    as configured in WHM. Due to space limitations on second hard drive, only daily backups are created.

    Then every night at 3am the following rsync command is executed to incrementally backup the contents of /mnt/hd2/cpbackup/daily to my bqbackup account:

    Code:
    rsync -avz -e ssh /mnt/hd2/cpbackup/daily [email]myaccount@myaccount.bqbackup.com[/email]:backup/daily
    
    Ive run it for two days and to my surprise rsync moves pretty much the whole (70gb) account over everytime instead of doing it incrementally.

    I assumed that incremental backup performed by WHM would only update those files on the second drive that have changed on the original drive and than rsync would realize that only those files have changed and would move only those files over to bqbackup server.

    This is not the case, so either whm is not doing incrementally or rsync is not doing it incrementally.

    Do you have any advice as to how to verify which one is the guilty party?

    Also, as a workaround, I decided to rsync directly from the account folder, i.e. /home/veryimportantaccount, but I need to dump the databases in there first.

    Whats a command/script to perform the dump of databases per account so that those databases can be easily restored from these dump files?

    Thanks in advance
     
  2. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    your rsync command is missing the --delete syntax. It should be:

    Code:
    rsync -avz -e ssh --delete /mnt/hd2/cpbackup/daily myaccount@myaccount.bqbackup.com:backup/daily
    To export/dump your databases, issue the following command:

    Code:
    mysqldump --opt -c -e -Q -u MySQLusername -p password databasename > /path/to/filename.sql
     
    #2 ANewDay, Mar 17, 2008
    Last edited: Mar 17, 2008
  3. vladgur

    vladgur Member

    Joined:
    Apr 18, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    can you tell me what that option does?

    man page says
    --delete delete files that don't exist on the sending side

    which doesnt mean much to me
     
  4. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    I do this nightly also. I am running backups from my backup box and it logs in and grabs backups off all my servers.

    rsync --delete-after --stats -vae ssh root@live-active-box:/backup/cpbackup/daily/ /backup/remotes/live-remote-box-backups/daily/


    is what I use and it only changes files that have changed. I notice you have -z (compress) ?
     
  5. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    it means that rsync will delete any files that are not present from your server but are present on the destination. It's exactly what cpbackup is doing daily.
     
  6. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    delete from the destination.

    it will delete a, b from backup server and transfer e, f from original server.
     
  7. vladgur

    vladgur Member

    Joined:
    Apr 18, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    delete on the server or delete on the destination?

    lets say i have following files contents:

    original server: c, d, e, f
    backup server: a, b, c, d

    what would be deleted and from where?
     
  8. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    Weird my post appeared above yours. :eek:
     
  9. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA

    --delete removes files on the backup side that have been removed on the "live" side. So if a user deletes some files and they get rsynced again ..the backup rsync will delete those also. Basically you get a folder by folder exact copy and when that folder changes in the way that files are no longer there on the live side ..they get removed on the backup side.
     
  10. vladgur

    vladgur Member

    Joined:
    Apr 18, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, ill try that flag out tonight
     
  11. vladgur

    vladgur Member

    Joined:
    Apr 18, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    thanks a lot guys, this has solved the issue :)
     
Loading...

Share This Page