#!/bin/bash
###远程主机路径
remote_path=59.110.165.127:/home/
###当前主机路径
current_path=/app/rsync_test
###同步方法
rsync_process(){
rsync -vtr $current_path $remote_path
}
###输入参数验证
if [ $1 = 'y' ]
then
echo "开始传输"
rsync_process
echo "传输完毕"
elif [ $1 = 'n' ]
then
echo "不传输"
else
echo "参数错误"
fi
一个代码远程同步shell脚本
最新推荐文章于 2022-09-02 15:04:50 发布