| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-25-2008, 04:37 PM
|
#1
|
|
LQ Newbie
Registered: Nov 2008
Posts: 4
Rep:
|
Compare directory trees on seperate servers ?
Hello all,
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.
|
|
|
|
11-25-2008, 06:41 PM
|
#2
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Hi.
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.
Dave
|
|
|
|
11-25-2008, 08:24 PM
|
#3
|
|
Member
Registered: Mar 2006
Posts: 110
Rep:
|
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.
Best Regards,
Rahul.
|
|
|
|
11-26-2008, 05:27 AM
|
#4
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Using 'locate' would be faster, but running 'updatedb' first, then 'locate' would likely not be so fast.
Dave
|
|
|
|
11-26-2008, 08:47 AM
|
#5
|
|
LQ Newbie
Registered: Nov 2008
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:53 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|