中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

rsync數(shù)據(jù)同步使用的內(nèi)容

2019-08-08    來源:愛站科技

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

rsync是一個很強大的同步工具,但是也有許多小伙伴們不知道如何使用rsync,今天小編就將為大家介紹關于rsync數(shù)據(jù)同步使用的內(nèi)容,想了解的小伙伴們一起來參考參考吧。

rsync(d)服務端啟動兩種方式
1.daemon 2.xinetd inetd
啟動后綁在 TCP/873 端口

% cat /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

配置 注意設置讀寫權限屬主
% cat /etc/rsyncd.conf

motd file = /var/log/rsync/welcome.msg
pid file = /var/log/rsync/rsyncd.pid
lock file = /var/log/rsync/rsync.lock
log file = /var/log/rsync/rsyncd.log

[rsyncwww]
comment = rsync www
path = /var/www/
use chroot = no
max connections = 4
read only = false
list = true
uid = nobody
gid = nobody
auth users = wwwuser
secrets file = /etc/rsyncd.secrets
hosts allow = 1.1.1.1,2.2.2.2
hosts deny = 0.0.0.0/0
ignore errors = yes
transfer logging = yes
log format = "%a %f %l"
#log format = "%o %h [%a] %m (%u) %f %l"

[rsyncroot]
comment = rsync root
path = /
use chroot = no
max connections = 4
read only = true
#read only = false
list = true
uid = root
gid = root
auth users = rootuser
secrets file = /etc/rsyncd.secrets
hosts allow = 1.1.1.1,2.2.2.2
hosts deny = 0.0.0.0/0
ignore errors = yes
transfer logging = yes
log format = "%a %f %l"


rsyncd.secrets 一行一個用戶 用戶名:密碼 格式

使用
rsync -auvPz --progress dir1 dir2
rsync -ztruvoglpD --progress dir1 dir2
rsync -ztruvoglpD --progress dir1/ dir2
rsync -ztruvoglpD --progress dir1/file1 dir2
如果不想包含某個目錄/文件可以設置--exclude

遠程使用
rsync 1.1.1.1:: 只列l(wèi)ist
rsync user@1.1.1.1::
rsync user@1.1.1.1::module
rsync user@1.1.1.1::module/path
如果沒有配置rsync server 可以通過 ssh 方式使用
rsync -e ssh -auvPz 1.1.1.1:/etc ./

同步時注意注意 / 最后的問題
不放/ 則目錄名也包含mirror
放 / 則只有目錄里面的東西mirror了

rsync -ztruvoglp --progress user@1.1.1.1::module/path ./
為了腳本調(diào)用方便 還可以調(diào)用 --password-file 同樣注意屬主權限
也可以設置環(huán)境變量RSYNC_PASSWORD=訪問含用戶認證的rsync

本文主要介紹的就是rsync數(shù)據(jù)同步使用的內(nèi)容,看完本文你肯定有不少收獲,希望本文能教會你更多東西。

標簽: rsync 數(shù)據(jù)同步

版權申明:本站文章部分自網(wǎng)絡,如有侵權,請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:Linux系統(tǒng)上如何實現(xiàn)虛擬FTP空間

下一篇:詳解Ubuntu下tftp服務器的安裝步驟