歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> rsync完全配置

rsync完全配置

日期:2017/2/27 14:28:00   编辑:更多Linux
  配置 rsync 系統環境 [root@Linuxas3 root]# uname -a Linux linuxas3.9812.net 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux 安裝rsync 在AS3 第二張CD上找到rsync-2.5.6-20.i386.rpm [root@linuxas3 root]# cd /mnt [root@linuxas3 mnt]# mount cdrom [root@linuxas3 mnt]# cd cdrom/RedHat/RPMS [root@linuxas3 RPMS]# rpm -ivh rsync-2.5.6-20.i386.rpm 配置/etc/rsyncd.conf 在rh9,as3系統上rsync安裝後,並沒有創建rsyncd.conf文檔,筆者是自己創建的rsyncd.conf文檔 [root@linuxas3 root]# vi /etc/rsyncd.conf uid=nobody gid=nobody max connections=4 use chroot=no log file=/var/log/rsyncd.log pid file=/var/run/rsyncd.pid lock file=/var/run/rsyncd.lock #auth users=root secrets file=/etc/rsyncd.pwd [postfix] path=/var/mail comment = backup mail ignore errors read only = yes list = no auth users = postfix [netkiller] path=/home/netkiller/web comment = backup 9812.net ignore errors read only = yes list = no auth users = netkiller [pgsqldb] path=/var/lib/pgsql comment = backup postgresql database ignore errors read only = yes list = no 選擇說明 uid = nobody gid = nobody use chroot = no # 不使用chroot max connections = 4 # 最大連接數為4 pid file = /var/run/rsyncd.pid #進程ID文件 lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log # 日志記錄文件 secrets file = /etc/rsyncd.pwd # 認證文件名,主要保存用戶密碼,權限建議設為600,所有者root [module] # 這裡是認證的模塊名,在client端需要指定 path = /var/mail # 需要做鏡像的目錄 comment = backup xxxx # 注釋 ignore errors # 可以忽略一些無關的IO錯誤 read only = yes # 只讀 list = no # 不允許列文件 auth users = postfix # 認證的用戶名,如果沒有這行,則表明是匿名 [other] path = /path/to... comment = xxxxx 密碼文件 在server端生成一個密碼文件/etc/rsyncd.pwd [root@linuxas3 root]# echo postfix:xxx >>/etc/rsyncd.pwd [root@linuxas3 root]# echo netkiller:xxx >>/etc/rsyncd.pwd [root@linuxas3 root]# chmod 600 /etc/rsyncd.pwd 啟動rsync daemon [root@linuxas3 root]# rsync --daemon 測試 [root@linux docbook]# rsync rsync://www.9812.net/netkiller


[root@linux tmp]# rsync rsync://[email protected]/netkiller PassWord: [chen@linux temp]$ rsync -vzrtopg --progress --delete [email protected]::postfix /tmp Password: rsync rsync://認證用戶@主機/模塊 rsync -vzrtopg --progress --delete 認證用戶@主機::模塊 /mirror目錄 添加到啟動文件 echo "rsync --daemon" >> /etc/rc.d/rc.local 完成!



Copyright © Linux教程網 All Rights Reserved