rsync for linux
作者 佚名技术
来源 Linux系统
浏览
623
发布时间 2012-03-29
rsync 服务器架设方法 1、 yum install rsync 2、 创建以下文件: a) [root@linuxsir:~]#mkdir /etc/rsyncd 注:在/etc目录下创建一个rsyncd的目录,我们用来存放rsyncd.conf 和rsyncd.secrets文件; b) [root@linuxsir:~]#touch /etc/rsyncd/rsyncd.conf 注:创建rsyncd.conf ,这是rsync服务器的配置文件; c) [root@linuxsir:~]#touch /etc/rsyncd/rsyncd.secrets 注:创建rsyncd.secrets ,这是用户密码文件; d) [root@linuxsir:~]#chmod 600 /etc/rsyncd/rsyncd.secrets 注:为了密码的安全性,我们把权限设为600; e) [root@linuxsir:~]#ls -lh /etc/rsyncd/rsyncd.secrets f) -rw------- 1 root root 14 2007-07-15 10:21 /etc/rsyncd/rsyncd.secrets g) [root@linuxsir:~]#touch /etc/rsyncd/rsyncd.motd 3、 下一就是我们修改 rsyncd.conf 和rsyncd.secrets 和rsyncd.motd 文件的时候了 rsyncd.conf 是rsync服务器主要配置文件,我们来个简单的示例;比如我们要备份服务器上的 /home 和/opt ,在/home中,我想把beinan和samba目录排除在外; # Distributed under the terms of the GNU General Public License v2 # Minimal configuration file for rsync daemon # See rsync(1) and rsyncd.conf(5) man pages for help # This line is required by the /etc/init.d/rsyncd script pid file = /var/run/rsyncd.pid port = 873 address = 192.168.1.171 #uid = nobody #gid = nobody uid = root gid = root use chroot = yes read only = yes #limit access to private LANs hosts allow=192.168.1.0/255.255.255.0 10.0.1.0/255.255.255.0 hosts deny=* max connections = 5 motd file = /etc/rsyncd/rsyncd.motd #This will give you a separate log file #log file = /var/log/rsync.log #This will log every file transferred - up to 85,000 per user, per sync #transfer logging = yes log format = %t %a %m %f %b syslog facility = local3 timeout = 300 [linuxsirhome] path = /home list=yes ignore errors auth users = linuxsir secrets file = /etc/rsyncd/rsyncd.secrets comment = linuxsir home exclude = beinan/ samba/ [beinan] path = /opt list=no ignore errors comment = optdir auth users = beinan secrets file = /etc/rsyncd/rsyncd.secrets 注: 关于 auth users 是 ![]() ![]() |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: Linux下的的进程查看命令下一篇: 总结WEB服务器搭建(一)
关于rsync for linux的所有评论