1) server:192.168.3.56
2) client:192.168.3.57
Server End:
Setsebool-p Allow_rsync_anon_write on
Setsebool-p Rsync_server on
A
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
Flags = IPV6
Socket_type = Stream
wait = no
user = root
Server =/usr/bin/rsync
Server_args =--daemon
Log_on_failure + = USERID
}
b) cat/etc/rsyncd.conf
UID = nobody
GID = Nobody
Use chroot = no
Max connections = 4
PID file =/var/run/rsyncd.pid
Lock file =/var/run/rsync.lock
Log file =/var/log/rsyncd.log
[Trans_tmp]
Path =/data/trans_tmp/
Ignore errors
Read Only = False
GID = 0
UID = 0
List = False
Hosts allow = 118.144.155.57
Hosts Deny = 0.0.0.0/32
Auth users = root
Secrets file =/etc/backserver.pas
c) Cat/etc/backserver.pas
Root:rootpw
d) chmod 600/etc/backserver.pas
E
Rm/var/run/rsyncd.pid
Rsync--daemon
Client End:
A
Vim/etc/sysconfig/selinux //need to edit it if above command show error
Setsebool-p Allow_rsync_anon_write on
Getsebool-a |grep rsync
Setsebool-p rsync_client on
b) Rsync-avz--progress--password-file < (echo Rootpw) root@192.168.3.56::trans_tmp/data/trans_tmp/
RSYNC-VZRTOPG--progress--password-file < (echo Rootpw) root@192.168.3.56::trans_tmp/data/trans_tmp/
Option explanation SEE below linker:
http://blog.csdn.net/xiaoxiaoniaoge/article/details/50971453