Shell批量分发脚本
[root@m01 /]# cat fenfa.sh #!/bin/sh . /etc/init.d/functions if [ $# -ne 2 ] then echo "usage:$0 localfile remotedir" exit 1 fi for n in 31 41 do scp -P 22 -rp $1 root@172.16.1.$n:$2 &>/dev/null if [ $? -eq 0 ] then action "172.16.1.$n successful" /bin/true else action "172.16.1.$n failure" /bin/false fi done
<< 上一篇
网友留言(0 条)