Debian 10 中搭建Rsync服务(实现远程异地同步备份)
现有一台Moodle服务器,系统为Debian 10,IP 地址:172.23.100.97。LNMP编译架构。为了增强数据安全性,既要采用本地备份Mariadb数据库及moodledata,也要采用远程异地备份。鉴于此,现搭建Rsync服务来实现本地和远程异地备份。
服务端:
1.为Debian 10更新源
#vim /etc/apt/sources.list,输入以下两行,再保存退出 。
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free
#apt clean all
#apt update
2.安装rsync
#apt-get install rsync 或
#aptitude install rsync (用于依赖较强的,当上行命令不能安装时采用)
#systemctl status rsync
此时无法启动,缺少/etc/rsyncd.conf
3.完善相关配置文件
#mkdir /etc/rsyncd
#cd /etc/rsyncd
#touch rsyncd.conf (注:也可以cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/rsyncd/)
#touch rsyncd.secrets
#chmod 0600 rsyncd.secrets(权限问题,特别重要)
#touch rsyncd.motd
(1)完善rsyncd.conf
#vim rsyncd.conf (输入如下内容)
##Global Options
address = 172.23.100.