個人用戶目錄通過rysnc遷移

目的: 從old_server遷移到new_server, 目錄都爲/data/john


old_server:


$cat rsyncd.conf
pid file = ./rsyncd.pid
port = 873
address = 100.81.140.50
uid = john
gid = users
use chroot = yes
read only = yes

hosts allow=192.168.1.0/255.255.255.0 10.218.78.9
hosts deny=*
max connections = 100
log file = ./rsync.log
transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300

[data]
path = /data/john
list=yes
ignore errors
auth users = rsync_john
secrets file = ./rsyncd.secrets
comment = data
exclude = lost+found

$sudo cat rsyncd.secrets
rsync_john:rsyncpassword


$ls -l rsyncd.secrets
-rw------- 1 root root 27 5月  26 11:16 rsyncd.secrets


sudo rsync --daemon  --config=./rsyncd.conf


new:

列舉rsync目錄:

rsync --list-only [email protected]::data

輸入:rsyncpassword


同步到本地當前目錄

rsync -avzP [email protected]::data .


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章