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

vladgur

Member
Apr 18, 2003
23
0
151
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][email protected][/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
 

ANewDay

Well-Known Member
Sep 11, 2006
86
0
156
USA
your rsync command is missing the --delete syntax. It should be:

Code:
rsync -avz -e ssh --delete /mnt/hd2/cpbackup/daily [email protected]: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:

vladgur

Member
Apr 18, 2003
23
0
151
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
 

rpmws

Well-Known Member
Aug 14, 2001
1,787
9
318
back woods of NC, USA
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][email protected][/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
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 [email protected]:/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) ?
 

ANewDay

Well-Known Member
Sep 11, 2006
86
0
156
USA
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.
 

ANewDay

Well-Known Member
Sep 11, 2006
86
0
156
USA
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.
 

vladgur

Member
Apr 18, 2003
23
0
151
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?
 

rpmws

Well-Known Member
Aug 14, 2001
1,787
9
318
back woods of NC, USA
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.
 

vladgur

Member
Apr 18, 2003
23
0
151
--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