您的位置:首页 > 其它

rsync服务器搭建,实现自动化备份

2017-07-15 16:00 295 查看
案例:
某电子商务企业有一个门户网站,Web服务器的操作系统是Linux,网站数据每天都会增加。为保证数据安全,需要建立一个远程容灾系统,将网站数据在每天凌晨3点30分备份到远程的容灾服务器上。由于数据量很大,每天只能进行增量备份,即仅仅备份当天增加的数据,当网站出现故障后,可以通过备份最大程度地恢复数据
rsync服务端配置:/etc/rsyncd.conf(需手动创建):
#全局配置
uid =
nobody
gid =
nobodyuse
chroot =
no
max
connections = 10
strict
modes = yes
pid file
= /var/run/rsyncd.pid
lock
file = /var/run/rsyncd.lock
log file
= /var/log/rsyncd.log

 
#模块配置

[webdata]
path =
/webdata

comment = webdata file
ignore
errors
read
only = no
write
only = no
hosts
allow = *
hosts
deny = 192.168.12.131
list =
false
uid =
root
gid =
root

auth users = test
 
secrets
file = /etc/server.pass

/etc/server.pass文件内容为认证帐号密码信息
vim /etc/server.pass
test:testpass
启动守护进程:
rsync --daemon
 

 
ss -antp | grep rsync

rsync客户端:
 

 /usr/local/bin/rsync
-vzrtopg  --delete  --progress
--exclude        
"*access*"  test@10.1.1.161::test
/test 
--password-file=/etc/test.pass
/etc/test.pass内容为test用户密码
 
testpass
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: