广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > 用rsync同步ecshop的data数据库备份

二次开发Ecshop二次开发

二次开发Ecshop二次开发

用rsync同步ecshop的data数据库备份

 用rsync同步ecshop的data数据库备份,这个是非常好的,我们可以通过设置任务,很轻松的对ecshop数据库进行备份。rsync确实是非常强大。比如服务器端的数据库在/ecshop/data
我们来做架构
1、架构
服务端192.168.1.251
客户端192.168.1.252

2、安装
yum -y install rsync

3、配置
(1)服务端
配置文件
[root@server /root]#vim /etc/rsyncd.conf
uid = root
gid = root
use chroot = no
max connections = 5
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log

[http]
path=/ecshop/data
exclude = wap/
comment = backup
ignore errors
read only = no
list = no
hosts allow = 192.168.1.0/255.255.255.0
auth users = root
uid = root
gid = root
secrets file = /etc/rsyncd.secrets

创建密码文件并设置权限
[root@server /root]#vim /etc/rsyncd.secrets
123456
root:123456
[root@server /root]#chmod 0600 /etc/rsyncd.secrets

启动
[root@server /root]#rsync --daemon

(2)客户端
创建密码文件设置权限
[root@client /root]#vim /etc/rsyncd.secrets
123456
root:123456
[root@client /root]#chmod 0600 /etc/rsyncd.secrets

同步命令
[root@client /root]#/usr/bin/rsync -auzv --progress --delete --password-file=/etc/rsyncd.secrets root@192.168.1.251::http /ecshop/data/
服务器端启动rsync
/usr/bin/rsync --daemon --config=/etc/rsyncd.conf