拷贝文件脚本

#!/bin/bash/


pcount=$#
if((pcount<1));then
   echo no args;
   exit;
fi


p1=$1;
fname=`basename $p1`


pdir=`cd -p $(dirname $p1) ; pwd`
cuser=`whoami`
for((host=1;host<4;host=host+1));do
  echo ------------node@host---------------
  rsync -rl  $pdir/$fname  $cuser@node$host:$pdir
done

猜你喜欢

转载自blog.csdn.net/haoxiaoyan/article/details/80394923