Linux-批量传输文件脚本

171 阅读1分钟

cp source destination

cp -r /abc /def

//把远程Hadoop101上的/opt/module拷贝到Hadoop102相同的位置
scp -r hadoop101:/opt/module/hadoop-2.7.7 hadoop102:/opt/module

[zhenghui@hadoop101 ~]$ scp -r root@hadoop101:/opt/module/hadoop-2.7.7/ root@hadoop102:/opt/module

yum -y install xinetd rsync

rsync -av hadoop101:/opt/module/hadoop-2.7.7 /opt/module

copypath文件脚本

#!/bin/bash
pcount=$#

echo count=$pcount
if ((pcount==0))