Article Title: rsync configuration and usage tutorial in linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The testing environment in this test uses Redhat AS4 (two servers, one server and one client)
Ip address of the rsync server: 192.168.23.102
Ip address of the rsync client: 192.168.23.100
-----------------------------------------------
Configure the server first:
1. Install the rsync package
[Root @ rhel403 old] # rpm-q rsync
Rsync-2.6.3-1
2. rsync only uses one configuration file:/etc/rsyncd. conf.
[Root @ rhel403 old] # more/etc/rsyncd. conf
Uid = nobody
Gid = nobody
Max connections = 200
Timeout = 600
Use chroot = no
Read only = yes
Pid file =/var/run/rsyncd. pid
Host_allow = 192.168.23.100 // write the IP address of the client here
# Syslog facility = local7
# Log file =/var/log/rsyncd. log
# Rsync config
# The 'standard' things
[Rsync_gmmold] // defines the synchronization path (the client uses this keyword to link)
Path =/gmm/old // path to be synchronized
Comment = gmmold // Annotation
3. Start the service
#/Usr/bin/rsync -- daemon
4. Add to boot
Echo "/usr/bin/rsync -- daemon">/etc/rc. local
5. Start during rsync check
# Ps-ef | grep rsync
6. Stop the service
# Kill 'cat/var/run/rsyncd. Pi'
---------------------------------------------------------------------------
The configuration of the client is as follows:
1. Install the rsync package
[Root @ rhel403 old] # rpm-q rsync
Rsync-2.6.3-1
2. synchronize with the server:
# Rsync-auqz 192.168.23.102: rsync_gmmold/tmp/old