一、 修改文件夹的所有者和所属组均为test用户 chown test:test /opt/文件夹名称 二、使用rsync同步文件 rsync主要用于备份和镜像。具有速度快、避免复制相同内容和支持符号链接的优点。 rsync -av $pdir/$fname $user@$host:$pdir/$fname 三、配置环境变量