The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
To compare selective file in different folders gmahesh2k UNIX for Dummies Questions & Answers 0 05-14-2008 11:03 PM
how to sync remote folders without overwriting prvnrk UNIX for Advanced & Expert Users 2 02-15-2008 09:53 PM
sync remote folders prvnrk Shell Programming and Scripting 0 02-15-2008 01:58 PM
SFTP:error while creating folders on remote server vgs Shell Programming and Scripting 0 08-01-2007 01:01 PM
Backing up Folders without some folders...;) chimpu Shell Programming and Scripting 1 04-26-2004 07:02 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-03-2007
Registered User
 

Join Date: Apr 2007
Posts: 4
Remote compare of folders

Hi,

Is there a way (either commands/tools/scripts/logic) to compare two given folders on different unix boxes. I want to compare folder a in Unix box 'A' with folder 'b' in Unix box 'B'. I can run the script in Unix box 'A'.
I am looking. for following results:
files/sub folders only in a
files/sub folders only in b
compare the file sizes of files which are present in both and display those files where there is a difference.

Thanks,
Sunil
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-04-2007
Registered User
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Rdist

I guess the standard Rdist utility could solve the problem,

Below is the same script that we can be used to identify the files/directories on in sync between the two machines,

#Create a Distfile on the Localhost
cat Distfile
#Distfile1
/tmp/A -> remote_host
install /tmp/A;

Assuming on the Local machine,we have under /tmp
./A
./A/B
./A/B/C
./A/B/C/D
./A/B/C/D/d
./A/B/C/D/d1
./A/B/C/c
./A/B/C/c1
./A/B/C/c2
./A/a


#On the local machine run,

rdist -vf Distfile

If on the remote machine only /tmp/A exists then,

Output:
updating host remotehost
need to install: /tmp/A/B
need to install: /tmp/A/a


You may require the ~/.rhosts file to be setup on the remote host( in case of rsh protocol ).Please search for rdist in the forum.


Thanks,
Nagarajan Ganesan.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:17 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