How can I diff two Redhat Linux servers?

Posted by Stuart Woodward on Server Fault See other posts from Server Fault or by Stuart Woodward
Published on 2009-06-01T09:49:30Z Indexed on 2011/11/26 9:58 UTC
Read the original article Hit count: 334

Filed under:
|

I have two servers that have should have the same setup except for known differences.

By running:

find / \( -path /proc -o -path /sys -o -path /dev \) -prune -o -print | sort > allfiles.txt

I can find a list of all the files on one server and compare it against the list of files on the the other server. This will show me the differences in the names of the files that reside on the servers.

What I really want to do is run a checksum on all the files on both of the servers and compare them to also find where the contents are different. e.g

find / \( -path /proc -o -path /sys -o -path /dev \) -prune -o -print | xargs /usr/bin/sha1sum

Is this a sensible way to do this? I was thinking that rysnc already has most of this functionality but can it be used to provide the list of differences?

© Server Fault or respective owner

Related posts about linux

Related posts about redhat