½©½ºÅ©¸³Æ® for¹® »ç¿ëÇÏ¿© scp ssh
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2022-05-03 21:13:54
 

# !/bin/sh

SEQ=0
for i in $(cat list_all)
do
    SEQ=`expr $SEQ +1`
    HOSTNAME="$i"

printf "########### ${SEQ} : ${HOSTNAME} ########\n"

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

sudo su
chown weblogic:wasgrp /work/0*.tar

EOT

sshpass  -p password11! scp -o StrictHostKeyChecking=no \
weblogic@${HOSTNAME}:/work/sse/0*.tar \
/DATA/mw_script/
done