#!/bin/bash
if [[ $# -lt 1 ]] ; then echo no params ; exit ; fi
params=$@
for (( i=1 ; i <= 3 ; i = $i + 1 )) ; do
tput setaf 1
echo ===============bi-kafka-$i $params===============
tput setaf 9
ssh bi-kafka-$i "source /etc/profile; $params"
done
#!/bin/bash
if [[ $# -lt 1 ]] ; then echo no params ; exit ; fi
p=$1
#echo p=$p
dir=`dirname $p`
#echo dir=$dir
filename=`basename $p`
#echo filename=$filename
cd $dir
fullpath=`pwd -P`
#echo fullpath=$fullpath
user=`whoami`
for (( i = 1 ; i <= 3 ; i = $i + 1 )) ; do
tput setaf 1
echo =================bi-kafka-$i==============
tput setaf 9
rsync -lr $filename ${user}@bi-kafka-$i:$fullpath
done ;
#!/bin/bash
if [[ $# -lt 1 ]] ; then echo no params ; exit ; fi
params=$@
for (( i=101 ; i <= 103 ; i = $i + 1 )) ; do
tput setaf 1
echo ===============oldboy-node$i $params===============
tput setaf 9
ssh oldboy-node$i "source /etc/profile; $params"
done
手机扫一扫
移动阅读更方便
你可能感兴趣的文章