rysnc
1、server client 模式
[root@dbback ~]# tree /etc/rsyncd/
/etc/rsyncd/
├── rsyncd.conf
├── rsyncd.motd
└── rsyncd.secrets
0 directories, 3 files
[root@dbback ~]# vim /etc/rsyncd/rsyncd.conf
uid = root
gid = root
user chroot = no
max connections = 200
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log
[data]
path=/klkj_back/oracle/
ignore errors = yes
read only = no
list = no
hosts allow = 192.168.10.5
auth users = orcl 不是系统用户
secrets file = /etc/rsyncd/rsyncd.secrets
[root@dbback ~]# cat /etc/rsyncd/rsyncd.secrets
orcl:orcl
which rsync查看路径
/usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf
client
rsync -av --progress --password-file=rsyncd.pass linux.x64_11gR2_database_1of2.zip orcl@10.10.5.16::data
client password file mode 600
client ip 要在server hosts allow 中不然会提示Unknown module
server 中的uid 要有对path的读写权限,写会提示 failed: Permission denied
2、用过ssh
rsync -av --progress linux.x64_11gR2_database_1of2.zip backuser@10.10.5.16:/home/backuser
ssh: connect to host 10.10.5.16 port 22: Connection refused
默认用的ssh 端口是22我的端口是24116
rsync -av --progress -e 'ssh -p24116' linux.x64_11gR2_database_1of2.zip backuser@10.10.5.16:/home/backuser
The authenticity of host '[10.10.5.16]:24116 ([10.10.5.16]:24116)' can't be established.
RSA key fingerprint is 10:2e:c6:f9:8a:09:ae:bf:4b:c0:ba:50:14:68:51:e3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[10.10.5.16]:24116' (RSA) to the list of known hosts.
backuser@10.10.5.16's password:
sending incremental file list
linux.x64_11gR2_database_1of2.zip
1239269270 100% 56.63MB/s 0:00:20 (xfer#1, to-check=0/1)
sent 1239420670 bytes received 31 bytes 36997632.87 bytes/sec
total size is 1239269270 speedup is 1.00
通过-e 来指定端口 backuser是系统用户
3、xinetd
[root@dbback ~]# vim /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 yes改no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon --config=/etc/rsyncd/rsyncd.conf
log_on_failure += USERID
}
浙公网安备 33010602011771号