A Is rsyncserver, started as the daemon, B is the backup machine, and used as the rsyncclient. Finally, crontab is used as A simple job, regularly run the file synchronization function on B. The installation and configuration of A are as follows: 1. apt-getinstallrsync may prompt that the system has been installed 2. configuration file/etc/rsyncd. conf does not have this configuration file by default, but it can be cp/usr/s
A is the rsync server, started as the daemon, B is the backup machine, and used as the rsync client. Finally, crontab is used for A simple job to regularly execute the file synchronization function on B.
The installation and configuration of A are as follows:
1. apt-get install rsync may prompt that the system has been installed
2. configuration file/etc/rsyncd. conf
By default, this configuration file is not available during installation, but you can copy the configuration file in the example by using cp/usr/share/doc/rsync/examples/rsyncd. conf/etc.
Vi/etc/rsyncd. conf has many parameters, but some of them can be ignored first.
[Ftp] Here is a module and multiple configurations can be configured. This is a default configuration provided by the system. The following is a configuration example on the local machine:
Bytes --------------------------------------------------------------------------------------------------
# So omit the "pid file" line completely in that case. pid file =/var/run/rsyncd. pid # syslog facility = daemon # socket options = # module options [share] comment = public archivepath =/var/www/pubuse chroot = nomax connections = 2 # lock file =/var/ lock/rsyncd # the default for read only is yes... read only = nolist = yesuid = nobodygid = nogroup # exclude = # exclude from = # include from = auth users = rsyncsecrets file =/etc/rsyncd. secretsstrict modes = yeshosts allow = 192.168.1.222 # hosts deny = ignore errors = yesignore nonreadable = yestransfer logging = yeslog format = % t: host % h (%) % o % f (% l bytes ). total % B bytes. timeout = 600 refuse options = checksum dry-rundont compress = *. gz *. tgz *. zip *. z *. rpm *. deb *. iso *. bz2 *. tbz
Bytes ---------------------------------------------------------------------------------------------
Here, the top is the pid file location. Then, a module named share is configured, and the maximum number of connections is 2, read only = no, which is specified as non-read-only (otherwise there will be permission issues during synchronization)
Auth users = rsync specifies a synchronization account named rsync. The authentication file for this account is/etc/rsyncd. secrets. Of course, we need to create this file.