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
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.