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

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

2019-08-08    來(lái)源:愛站科技

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬(wàn)Linux鏡像隨意使用

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

rsync(d)服務(wù)端啟動(dòng)兩種方式
1.daemon 2.xinetd inetd
啟動(dòng)后綁在 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
}

配置 注意設(shè)置讀寫權(quán)限屬主
% 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 一行一個(gè)用戶 用戶名:密碼 格式

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

遠(yuǎn)程使用
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
如果沒(méi)有配置rsync server 可以通過(guò) ssh 方式使用
rsync -e ssh -auvPz 1.1.1.1:/etc ./

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

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

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

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

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

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

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