Is there an easy way to verify that two directory trees on two separate machines are identical, and that all files within the directory tree are also identical? I want to make sure that two separate machines mirror the exact same data.

link|improve this question
feedback

migrated from stackoverflow.com Jul 23 '10 at 17:40

This question came from our site for professional and enthusiast programmers.

2 Answers

If you are using linux, you can use rsync to accomplish this. If you only want to check, from the source machine, you can do something like:

rsync -av --dry-run /source/path dstcomputer:/dest/path

The --dry-run will not actually change any data, only report. You can re-run without that option to actually sync the data.

link|improve this answer
feedback

If you are using Windows, you can use robocopy to accomplish this (not included by default before Vista, but you can get the Resource Kit for XP). If you only want to check, from the source machine, you can do something like:

robocopy /source/path /dest/path /MIR /L

The /L will not actually change any data, only report. You can re-run without that option to actually sync the data.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown