Script running on remote machine - How ??

Hi All,

This was an interview question
" There is a clean-up shell-script in one UNIX machine and it is connected to 100 other UNIX machines.
Howe can we run the script on all the 100 machines without ftping/copying the script to target machines ?

I was unable to answer, please answer if you know.

Thanks in advance
Coolbhai

Answer: Use Remote Shell.

The name of the command is not the same on every version of unix. Mostly it's called "remsh" (Remote Shell) but I have seen is called "rsh" (which nowadays the name for the Restricted Shell).

rsh would still require the script to be accessible on the system. Since the script only exists on "one Unix machine", the other 100 machines are most likely accessing the script via a network share (NFS)

Also, you could run a script that contains a here document whose content are used as an argument to ssh to all the remote machines.

Sorry didn't make myself clear.
The script would need modification to use "remsh" for each command and to take the computer name as a parameter. When we do this we also treat the local computer as a remote computer to keep the script consistent. For performance reasons it is preferable to execute the cleanup commands on the computer which owns the discs.

The NFS solution is an option but may not be practical because the central machine would need to maintain 100 sets of NFS mapped filesystems. What if there are 50 mountpoints to maintain on each remote server? Even with the automounter this would be a nightmare.

In the real world you would proliferate the script to each machine and execute it from cron.

Thanks all for the reply.