- 1. 客户端脚本
- 2. 服务器端的脚本
- 3. sersync2自动的数据同步
#!/bin/bash yum -y install rsync &>dev/null echo "123456" > /etc/rsync.password chmod 600 /etc/rsync.password echo "ok ...."
测试:
2. 服务器端的脚本#!/bin/bash yum -y install rsync &>/dev/null [ $? -eq 0 ] && echo "rsync install ok..." systemctl start rsyncd &>/dev/null systemctl enable rsyncd &>/dev/null #配置文件 cat > /etc/rsyncd.conf </etc/rsync.password chmod 600 /etc/rsync.password #创建备份目录 mkdir -p /backup chown -R rsync.rsync /backup systemctl restart rsyncd &>/dev/null [ $? -eq 0 ] && echo "restart is ok ... "
测试:
rsync -avz /etc/hosts rsync_backup@192.168.80.31::backup --password-file=/etc/rsync.password3. sersync2自动的数据同步
下载压缩包:https://pan.baidu.com/s/1PtOlqdFgOzqhWDCse-6fHA
链接:https://pan.baidu.com/s/1PtOlqdFgOzqhWDCse-6fHA
提取码:8dda
rz -E tar xf mv .. sersync mv sersync /usr/local/ cd /usr/local/sersync vim confxml.xml
启动
cp /usr/local/sersync/sersync2 /usr/bin 启动 sersync2 -dro /usr/loacl/sersync/confxml.xml 关闭 ps -ef | grep sersync2 kill -9
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)