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?
LVL 2
erzoolanderAsked:
Who is Participating?
 
Gerwin Jansen, EE MVETopic Advisor Commented:
rsync --dry-run -avzhe ssh root@xxx.xxx.x.xxx:/var/www/ /localdestination/

will show you a list of files, yes. It is showing you the files that still need to be copied. You can also add --itemize-changes to just get the incremental file list in a somewhat different format:

rsync --dry-run --itemize-changes -avzhe ssh root@xxx.xxx.x.xxx:/var/www/ /localdestination/

this is exactly showing your discrepancies.

Try with a smaller folder first if you like, rsync that folder, remove one file on the destination and then run again with the --dry-run --itemize-changes options added.
0
 
ozoCommented:
rsync --size-only --list-only
or
diff the output of du on both machines.
0
 
erzoolanderAuthor Commented:
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 :)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Gerwin Jansen, EE MVETopic Advisor Commented:
Take the rsync command you had and add: --dry-run
0
 
serialbandCommented:
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

0
 
ExpertNotReallyCommented:
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.
0
 
erzoolanderAuthor Commented:
rsync -avzhe ssh root@xxx.xxx.x.xxx:/var/www/ /localdestination/

is the command I used.
0
 
erzoolanderAuthor Commented:
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?
0
 
SandyCommented:
add --stats to the comand to get statistics at the end so you can compare easily with numbers

TY/SA
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.