[shell] [AIX] 远程运行脚本
远程登录系统并执行任务返回结果
ssh -q host
root@redhat8:/usr/bin/script/ $ cat export_role.sh #!/bin/bash # Script to ge the value of parameter in all systems cd /usr/bin/script/echo $PWD echo " Run this script as a root user " echo " export oracle user list " echo " continue?(y/n) : " read answer if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then exit fi starttime=`date +%s` #start run time echo "$starttime" while read -r USER OACLESID do { respond=$(ssh -q redhat${ORACLESID}a0 "/usr/bin/script/export_role.sh $USER $OACLESID") echo -e "${ORACLESID}: ${respond}" unset respond }& done < ./oracle_system.lst wait endtime=`date +%s` #end run time echo " TIME: `expr $endtime - $starttime` "
每天进步一点点,多思考,多总结
版权声明:本文为CNblog博主「zaituzhong」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。