通过scp批量推送文件到远程目录


 


[root@openfire1 script]# cat test.sh 
#!/bin/bash  

#通过scp推送文件到远程目录
for ip in `cat iplist` 
do  
    echo $1
    if [[ -z $1 ]]; then  #"-z",如果为空 
        echo "Not find command."
        break 
    else  
        echo "$ip----------------------"
        scp -r -p $1 $ip:$2
    fi
done  

[root@openfire1 script]# sh test.sh /

 

posted on 2016-01-15 14:18  vlen  阅读(1734)  评论(0编辑  收藏  举报