Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    Apr 2003
    Posts
    23

    Lightbulb Backup Issues: whm or rsync dont do incremental plus mysql dump questions

    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 myaccount@myaccount.bqbackup.com: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. #2
    Member
    Join Date
    Sep 2006
    Location
    USA
    Posts
    86

    Default

    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
    Last edited by ANewDay; 03-17-2008 at 04:29 PM.

  3. #3
    Member
    Join Date
    Apr 2003
    Posts
    23

    Default

    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. #4
    Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,858

    Default

    Quote Originally Posted by vladgur View Post
    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 myaccount@myaccount.bqbackup.com: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
    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) ?
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  5. #5
    Member
    Join Date
    Sep 2006
    Location
    USA
    Posts
    86

    Default

    Quote Originally Posted by vladgur View Post
    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
    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. #6
    Member
    Join Date
    Sep 2006
    Location
    USA
    Posts
    86

    Default

    Quote Originally Posted by vladgur View Post
    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?
    delete from the destination.

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

  7. #7
    Member
    Join Date
    Apr 2003
    Posts
    23

    Default

    Quote Originally Posted by ANewDay View Post
    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.
    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. #8
    Member
    Join Date
    Sep 2006
    Location
    USA
    Posts
    86

    Default

    Weird my post appeared above yours.

  9. #9
    Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,858

    Default

    Quote Originally Posted by vladgur View Post
    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?

    --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.
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  10. #10
    Member
    Join Date
    Apr 2003
    Posts
    23

    Default

    Quote Originally Posted by rpmws View Post
    --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.
    Thanks, ill try that flag out tonight

  11. #11
    Member
    Join Date
    Apr 2003
    Posts
    23

    Default

    thanks a lot guys, this has solved the issue

Similar Threads & Tags
Similar threads

  1. rsync Server Backup, Minor Issues After Restore
    By Magotchi in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-16-2011, 03:00 PM
  2. incremental backup, rsync not copying databases?
    By haxxor23 in forum Data Protection
    Replies: 2
    Last Post: 12-02-2008, 11:26 AM
  3. MySQL Incremental backup.
    By rvbalraj in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-28-2008, 05:56 AM
  4. Backup and Mysql dump
    By phoenixweb in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-20-2006, 10:44 AM
  5. Backup MySql (dump) from CPANEl and phpmyadm are different
    By Cristian99 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-03-2006, 05:16 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube