The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-30-2007
Registered User
 

Join Date: Jul 2007
Posts: 53
Stumble this Post!
map comparsion

Hi all

I have to compare maps/files on two seperate boxes and the output must be as following:
1)list the maps/file on box1
2)list the maps/file on box2
3)List maps in both the environments
a) which are same
b)which are different

pls any ideas are appreciated
thnks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-30-2007
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,854
Stumble this Post!
Use find to create a file that has checksums. Do it on box1 and then box2.
Code:
find /path/to/maps -type f  -exec cksum {} \; | awk '{print $3, $2, "box1" }' > box1.lis
find /path/to/maps -type f  -exec cksum {} \; | awk '{print $3, $2, "box2" }' > box2.lis
Next, merge the two files into one larger file with sort.

Now you can awk to find the duplicates, and the checksums tell you if the files are the same or not. box1.lis and box2.lis tell you the names of all of the files on each box.

If this did not so homework-ish, I'd show the awk code.
Reply With Quote
  #3 (permalink)  
Old 08-30-2007
Registered User
 

Join Date: Jul 2007
Posts: 53
Stumble this Post!
map comparsion

Quote:
Originally Posted by jim mcnamara View Post
Use find to create a file that has checksums. Do it on box1 and then box2.
Code:
find /path/to/maps -type f  -exec cksum {} \; | awk '{print $3, $2, "box1" }' > box1.lis
find /path/to/maps -type f  -exec cksum {} \; | awk '{print $3, $2, "box2" }' > box2.lis
Next, merge the two files into one larger file with sort.

Now you can awk to find the duplicates, and the checksums tell you if the files are the same or not. box1.lis and box2.lis tell you the names of all of the files on each box.

If this did not so homework-ish, I'd show the awk code.
Hi Jim t
thanks for the reply,but there is a constraint which i forgot to tell you and that is , i must be on the source server only and need to remotely log onto the target server using the ssh command.
Thank You once again
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0