½©½ºÅ©¸³Æ® for¹® »ç¿ëÇÏ¿© µÎ °³ ÀÎÀÚ¸¦ ¹Þ¾Æ ssh scp
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2022-05-03 21:06:24
 

# cat for_was_exec_sse.sh
#!/bin/sh

STIME='date +%s`
printf "start time : `date -d @$STIME \"+%Y.%m.%d %H:%M:%S\" `
\n"

SEQ=0
args=($(cat list_sse_exec3))
for (( i=0; $i<${#args[@]}; i++ ))
do
  SEQ=`expr $i / 2 + 1`
  HOSTNAME=${args[$i]}
  SCD=${args[$i + 1]}

sshpass -p password11! ssh -o ConnectTimeout=3 -o StrictHostKeyChecking=no weblogic@${HOSTNAME} /bin/bash <<'EOT'

sudo su
cd /work/sse/sseunix
sh start.sh $SCD

EOT

i=`expr $i + 1`
done

ETIME=`date +%s`

printf "end time : `date -d @$ETIME \"+%Y.%m.%d %H:%M:%S\" `