Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

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

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

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.