next up previous contents
Next: Adding user accounts Up: System Administration Guide Previous: Powering up the system   Contents

doall and copyall global commands

The scripts /usr/bin/doall and /usr/bin/copyall allow you to perform global commands or copy a file onto a group of compute nodes. These scripts are mainly intended for use by the administrator logged in as root, but will work for normal users as well (provided the correct permissions allow it). To specify which hosts are used you first need to setup a script called host.list (similar to a PVM hosts file) which lists all the compute nodes. For example if you have 4 compute nodes called sc00,....sc03 then your host.list file looks like:
sc00
sc01
sc02
sc03

The host.list should be placed in the user's home directory on the front end server e.g in /root for root user. You should note that the server and compute nodes are all set as equivalent hosts in the /etc/hosts.equiv so you do not need to setup a .rhosts either for either ordinary users or root.

doall: this executes the same command on all hosts listed in the host.list file. For example to check all the clocks:

[nrcb@scserve nrcb]$ doall date
=====================
sc00.streamline
=====================
Mon Feb 12 12:26:16 GMT 2001
=====================
sc01.streamline
=====================
Mon Feb 12 12:28:08 GMT 2001
=====================
sc02.streamline
=====================
Mon Feb 12 12:30:34 GMT 2001
=====================
sc03.streamline
=====================
Mon Feb 12 12:25:11 GMT 2001

copyall: This copies a file from the front end server to all the hosts listed in the host.list file - e.g

[root@scserve /etc]# copyall /etc/sendmail.cf /tmp
=====================
sc00.streamline
=====================
=====================
sc01.streamline
=====================
=====================
sc02.streamline
=====================
=====================
sc03.streamline
=====================
copies the file /etc/sendmail.cf from the from end server to the file /tmp/sendmail.cf on each node listed in host.list. You should always use full paths when naming remote files.
doall and copyall use the rsh and rcp commands respectively.

If you need to change directory before executing a command on each node you should enter a subshell - e.g

[root@server /root]# doall '( cd /opt/score/work ; rm *.rpm )'
WARNING: The doall and copyall commands can save you a lot of effort, but at the same time can be very dangerous - you could wipe vital files off all compute nodes or even worse !! Remember all commands executed remotely will not be aliased. Please make sure you are giving the correct commands before you press that return key......
next up previous contents
Next: Adding user accounts Up: System Administration Guide Previous: Powering up the system   Contents
2004-06-17