Write a shell script that operates in the background on two machines and ensures that the contents of a named directory on one machine is always a mirror image of another named directory on the other machine.

What will be an ideal response?

Such a script would run in a loop where it would sleep some amount of time and then check to see
if files have changed. The check might consist of using rsh to do an ls of the directory on the
remote machine and then diff to compare it to an ls listing from the local machine. New files on
either machine can be easily found (present only in one of the two lists). The modification dates of
files that are present in both lists should be compared and the file with the latest date should be
considered the correct one. Another way to do this would be to leave a bookmark file each time
through the loop and then use find to generate a list files that have been modified since the last
time the directory was examined. In both of these cases, you will still need a way to find files that
have been deleted. Ultimately you may find that the best way is to maintain a full master list of all
the files, then you can identify new files, old files, and deleted files.

Computer Science & Information Technology

You might also like to view...

Which MEF service type provides a link similar to a T1?

A) E-Tree B) E-LAN C) E-Mesh D) E-Line

Computer Science & Information Technology

Give a definition of a priority queue.

What will be an ideal response?

Computer Science & Information Technology