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


通过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 /

 

相关文章:

  • 2021-06-28
猜你喜欢
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2021-09-18
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案