Link to home
Start Free TrialLog in
Avatar of erzoolander
erzoolander

asked on

RSync / compare?

Quick question about rsync results - and comparing file structure/etc.

I am migrating about 2TB of data from one server to another.  The rsync completed this morning - and when I go to the old server - and do a disk usage check on the old server/compare it to the new server - there's about a 2GB discrepancy.

There are literally thousands of files on the system...  Is there any way to do an easy/effective comparison to see what is the cause of the discrepancy?
Avatar of ozo
ozo
Flag of United States of America image

rsync --size-only --list-only
or
diff the output of du on both machines.
Avatar of erzoolander
erzoolander

ASKER

I haven't used those tags before with rsync (kind of an rsync noob).

So would the command go like:

rsync --size-only --list-only ssh root@xxx.xxx.x.xxx:/var/www/ /newdir/

?

It's giving me an error on that :)
Take the rsync command you had and add: --dry-run
What was your rsync command?  Which had a bigger size?  Did you use the -l option to force the copy of symlinks as links, otherwise, they may just expand the files.

You can find try finding the symlinks in each tree to see if they match

find -L /PATH/ -type l

Open in new window

Try this
rsync -avHc --dry-run ssh root@xxx.xxx.x.xxx:/var/www/ /newdir/

Open in new window

This should list the files that are different, if any.

-a               archive mode
-v               verbose
-H              preserve hard links
-c               checksum
--dry-run  actions simulated

I got this from this forum, it just so happened I needed this recently.
rsync -avzhe ssh root@xxx.xxx.x.xxx:/var/www/ /localdestination/

is the command I used.
The dry run command doesn't seem to really do much - except show me the entire list of files (which is odd - because I would've thought it ought be incremental...meaning...files that have transferred ought not show).  I know they're there on the destination location - because I can see them.  So ought they not have been omitted from the dry run?
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial