LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-25-2008, 04:37 PM   #1
dhg1848
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Rep: Reputation: 0
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.
 
Old 11-25-2008, 06:41 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
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
 
Old 11-25-2008, 08:24 PM   #3
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
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.
 
Old 11-26-2008, 05:27 AM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Using 'locate' would be faster, but running 'updatedb' first, then 'locate' would likely not be so fast.

Dave
 
Old 11-26-2008, 08:47 AM   #5
dhg1848
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare records in two tables in seperate My Sql database using perl script chandanperl Programming 1 08-22-2008 09:33 AM
LXer: Protecting directory trees with gpgdir LXer Syndicated Linux News 0 04-25-2008 12:20 AM
Q: on deleting directory trees n00bJoe Arch 3 03-09-2006 12:13 PM
How to compare records in two tables in seperate My Sql database using shell script sumitarun Programming 5 04-14-2005 09:45 AM
How to keep 2 directory trees synchronised? hrr Linux - General 2 07-02-2003 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration