日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

rsync同步配制

發布時間:2025/7/14 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 rsync同步配制 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

1、下載安裝rsync

wget http://rsync.samba.org/ftp/rsync/rsync-3.1.2.tar.gz tar zxvf rsync-3.1.2.tar.gz cd rsync-3.1.2 ./configure --prefix=/usr ;make ;make install

? ?2、配制rsync.conf

# vim /etc/rsyncd/rsyncd.conf

uid = nobody gid = nobody port = 873 # 指定運行端口,默認是873,您可以自己指定 hosts allow = 192.168.102.101 # 允許訪問的客戶機,多個以逗號隔開 #hosts deny = 0.0.0.0/32 #拒絕訪問的 use chroot = no max connections = 10 timeout = 500000 pid file = /var/run/rsyncd.pid ##pid文件的存放 lock file = /var/run/rsync.lock ##鎖文件的存放位置 log file = /var/log/rsyncd.log ##日志記錄文件的存放 #motd file = /etc/rsyncd.motd #歡迎 secrets file = /etc/rsyncd/rsyncd.passwd ## 指定認證文件 ## 上面這段是全局配置,下面的模塊可以有 [test] ## 模塊名字,自己命名 path = /home/rsync/test #指定文件目錄所在位置,這是必須指定 comment = rsync files ##注釋 ignore errors ##忽略IO read only = no #list = no ## 是否把rsync 服務器上提供同步數據的目錄顯示 ## 下面這一行,同步驗證時用的賬號,如果沒有這項就是匿名同步,client同步時不用用戶名也能同步。 auth users = rsync

3、生成密碼文件

#vim /etc/rsyncd/rsyncd.passwd

rsync:123456@789

4、文件權限修改

chmod 644 /etc/rsyncd/rsyncd.conf chmod 600 /etc/rsyncd/rsyncd.passwd

5、啟動rsync

/usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf

也可以將上面的命令寫到/etc/rc.local里,實現開機自啟動rsync服務

6、客戶端配制

基本同服務器的配制.

7、手動同步

rsync -avzP david@192.168.1.16::test ?/tmp/david/

8、自動同步加入定時任務里

0 9 * * * /usr/bin/rsync -vzrtopg --delete --progress rsync@192.168.1.16::test /home/data/nginx/html/ --password-file=/etc/rsyncd/rsyncd.passwd

?

轉載于:https://my.oschina.net/u/933928/blog/743570

總結

以上是生活随笔為你收集整理的rsync同步配制的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。