Compare directory trees on seperate servers ?
I have two servers with "similar" OS loads on them. One server is production the other is test. I wish to compare the differences in the directory structure/file systems for the two.
Can anyone help w/ a simple 'diff' type command for server A and server B? An added note, these servers, unfortunately are on different networks and cannot talk to one-another.
I am a bit of a newb to the land of Linux so I apologize for the potential simplicity of this thread.
Kind Regards and Thanks ahead of time!
BTW...SuSE 10 is the OS on both.
I'm sure there's a few ways to do this but here's how I'd go about it.
Let's say you want to compare the /usr filesystems (if you want the whole system, replace /usr with /) on hosts a and b .
On a: # find /usr | sort > filesystem.out.a
On b: # find /usr | sort > filesystem.out.b
Then get the filesystem.out.X files onto one machine, and run:
# diff filesystem.out.a filesystem.out.b
If the output is a bit big, try 'diff -d'. You should get a smaller output, but it may take a bit longer.
As already replied by Dave, diff would work for you. Since you are using linux, better use "locate" command to get the listing, it would be amazingly fast.
Here is what you need to do:-
1. On both servers (I assume its Linux), run "updatedb". This will build an internal slocate database for "locate" command.
2. Run the command and grep for the filesystem you wish to compare:-
locate etc > filenameA
3. Afterwards just do the diff as suggested earlier.
Using 'locate' would be faster, but running 'updatedb' first, then 'locate' would likely not be so fast.
Thanks for all the responses guys! I'm sure you'll be hearing from me quite a bit more in the near future. Have a great Holiday.
|All times are GMT -5. The time now is 07:42 AM.|