I have written bash shell script, which will download artifact and untar it and copy it to the destination folder. After that it does some more steps. and i am running this script from mco command which will execute in many hosts parallely. but i want restrict one perticular command to execute only once. how do i do that. except that command all other should execute in all host
myscript.sh :
if [ "$#" -eq 2 ]; then
Name=$1
version=$2
tarname=$Name"-"$version-SNAPSHOT.tar
SNAPSHOT=$Name-$version-SNAPSHOT
if [[ ! -e "/<path>/$tarname" && "/<path>/$SNAPSHOT" ]]; then
do something // this command i want to execute only once or only in one host.
fi
I execute this script like this :
mco shellcmd '/path/myscript.sh name version' -I /host-10[012345]/
this script executes in 50 host at a time but one particulate command should execute in only one host/one time.
how do we do this.
Thanks,