sync files from two different servers.

I have a directory called UNIX 1 which contains 2 files and uploaded into two different servers. Now I want to check whether the directory contains both the files. If not, then need to sync the directory.

Please let me know how to do that in shell scripting.

rsync is the answer. That utility will check for differences and synchronize the 'chunks" of the file that are different.

wget can also be used if you always need to only download the new/modified files. We do have a unix script running in PROD that uses "wget" to sync up the local directory with the remote ftp server by downloading the new/modified files.

wput can be used to do the other way round that is to only upload new/modified files to the remote ftp directory.

regards,
Arun.