I have a "big job" script which I need to run several instances over several servers. Each script returns an integer where > 0 means error.
What I need to do is to check the status of the returned code to see if it has failed. Here is what i am trying to do.
for rhost in `cat server list`
do
if [ $rhost == "`hostname`" ]
then
# Its local
/tmp/bigjob.sh &
else
# It's remote
rcp /tmp/bigjob.sh ${rhost}:/tmp/bigjob.sh
rsh $RHOST /tmp/bigjob.sh &
fi
done
# wait for background jobs to complete
wait
The problem is how do I find out which one succeeds and which job failed.
thx, in advance
What I need to do is to check the status of the returned code to see if it has failed. Here is what i am trying to do.
for rhost in `cat server list`
do
if [ $rhost == "`hostname`" ]
then
# Its local
/tmp/bigjob.sh &
else
# It's remote
rcp /tmp/bigjob.sh ${rhost}:/tmp/bigjob.sh
rsh $RHOST /tmp/bigjob.sh &
fi
done
# wait for background jobs to complete
wait
The problem is how do I find out which one succeeds and which job failed.
thx, in advance