首页 > 代码库 > rsync配置及优化
rsync配置及优化
daemon端配置: 创建配置文件 [root@Backup-server ~]# touch /etc/rsyncd.conf [root@Backup-server ~]# vi /etc/rsyncd.conf [root@Backup-server ~]# cat /etc/rsyncd.conf #rsync server #created by oldboy 15:01 2009-6-5 ##rsyncd.conf start## uid = rsync gid = rsync use chroot = no max connections = 2000 =====>最大连接数 timeout = 600 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log ignore errors read only = false ====》可读写 list = false ====》不可远程列表 hosts allow = 192.1.1.0/24 hosts deny = 0.0.0.0/32 ====》不拒绝ip地址 auth users = rsync_backup secrets file = /etc/rsync.password ====》存放用户和密码的文件 ##################################### [backup] ====》共享模块 comment = Backup server by lufeng 3.15 =====》注释 path = /backup ====》共享目录 可粘贴部分 #rsync server #created by oldboy 15:01 2009-6-5 ##rsyncd.conf start## uid = rsync gid = rsync use chroot = no max connections = 2000 timeout = 600 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log ignore errors read only = false list = false hosts allow = 192.1.1.0/24 hosts deny = 0.0.0.0/32 auth users = rsync_backup secrets file = /etc/rsync.password ##################################### [backup] comment = www by lufeng path = /backup 创建用户及共享目录 [root@Backup-server ~]# useradd rsync -s /sbin/nologin -M [root@Backup-server ~]# mkdir /backup [root@Backup-server ~]# chown -R rsync /backup/ 创建密码文件 [root@Backup-server ~]# echo "rsync_backup:199429" >/etc/rsync.password [root@Backup-server ~]# cat /etc/rsync.password rsync_backup:199429 [root@Backup-server ~]# chmod 600 /etc/rsync.password 启动rsync及查看端口 [root@Backup-server ~]# rsync --daemon [root@Backup-server ~]# ps -ef|grep rsync|grep -v grep [root@Backup-server ~]# netstat -lntup|grep rsync [root@Backup-server ~]# lsof -i :873 设置开机启动 [root@Backup-server ~]# echo "rsync --deamon" >>/etc/rc.local [root@Backup-server ~]# cat /etc/rc.local 客户端配置: 创建密码文件 [root@lnmp01 ~]# echo "199429" >/etc/rsync.password [root@lnmp01 ~]# chmod 600 /etc/rsync.password [root@lnmp01 ~]# cat /etc/rsync.password 199429 推送备份rsync push: [root@lnmp01 ~]# rsync -avz /tmp/ rsync_backup@192.1.1.7::backup --password-file=/etc/rsync.password 增量备份成功,结合定时任务实现定时备份。
本文出自 “大梦初醒” 博客,请务必保留此出处http://bestlufeng.blog.51cto.com/11790256/1907052
rsync配置及优化
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。