Remote Data Synchronization and backup using rsync in linux

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.