Rsync is an efficient remote data backup tool. The port number of this service is 873,
Is a non-independent service under Liunx, managed by the xinetd super service, instead of listening to port 873.
Advantages:
1. rsync can use ssh and ssl remote control to connect to a remote host for backup, depending on the sshd service.
2. Incremental Backup can be implemented. Full backup is performed when a connection is established for the first time, and only changed data will be synchronized in the future.
3. You can use your own socket for synchronization. You can set a password on the server to restrict access.
Disadvantage: Real-time synchronization is not supported. You need to install the lsyncd tool to assist in real-time synchronization.
Configuration steps:
1. Install the rsync software on the client and server respectively. Yum install rsync *-y
2. Write the configuration file rsyncd. conf on the server. The file does not exist. manually create vim/etc/rsyncd. conf.
3. You must grant the 600 permission to create the password file vi/var/rsync. pass chmod 600/var/rsync on the server,
The content is in user: password format.
4. Set the synchronization directory and permissions in the rsyncd. conf configuration file on the server.
5. Check the server synchronization directory rsync -- list-only rsync: // 172.16.0.1.
6. The client synchronizes the server Directory rsync-av -- delete rsync: // 172.16.0.1:/share
7. The client synchronously accesses the server with access permissions.
Rsync-av -- delete -- password-file =/var/myscret. pass rsync: // user@172.16.0.1/share/backup
8. The client creates a password to store the file myscrete. pass. The content is the server access password, which allows direct access and is suitable for scripts.
-- Delete indicates that the image is synchronized to the server directory, including the deleted files. Otherwise, only the added files are synchronized.
2. Configure the lrsyncd tool for real-time synchronization.
1. Download The lrsyncd.tar.gz package and install it. Cp/usr/local/share/doc/lsyncd/lrsync. lua/usr/loca/etc
Edit the configuration file.
2. Run lsyncd/usr/local/etc/lrsync. lua OK.