Install rsync on centos

Source: Internet
Author: User

Install rsync on centos
Install rsync software first

Install yum

Yum install rsync,

Compile and install

Visit http://rsync.samba.org/to download the latest rsyncstable version.

Wget http://rsync.samba.org/ftp/rsync/src/rsync-3.0.9.tar.gz

Wget http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.0.9.tar.gz

Tar-zxvf rsync-3.0.9.tar.gz
Tar-zxvf rsync-patches-3.0.9.tar.gz

Cd rsync-3.0.9

./Configure

Make

Make install

Installation Complete

Then configure rsync

The rsync service requires three files.

Rsyncd. conf rsync service configuration file

The rsyncd. secrets rsync service user password file must be an existing user on the server

Rsyncd. motd rsync service logon prompt information

To ensure password security, you must change the rsyncd. secrets permission to 600 chmod 0600 rsyncd. secrets.

By default, the mkdir-p/etc/rsyncd files do not exist.

Touch rsyncd. conf

Touch rsyncd. secrets

Touch rsyncd. motd

Add configuration file content:

Vim/etc/rsyncd. conf

Pid file =/var/run/rsyncd. pid rsync service pid file storage location

Port = 873 port number

Address = 192.168.1.2 address of the rsync Service

Uid = root user

Gid = root user group

Usechroot = yes chroot settings

Read only = no read-only

Hosts allow = ip addresses allowed to access 192.168.1.0/24

Hosts deny = * ip address for Access prohibited

Max connections = 5 max connections

Motd file =/etc/rsyncd. motd: Specifies the location of the information file.

Log file =/var/log/rsyncd. log location of the log file

Log format = % t % a % m % f % B log File format

Syslog facility = local3

Timeout = 300 connection timeout

Secrets file =/etc/rsyncd. secrets Password file

[Backup]

Path =/test

Auth users = root

Lsit = true

Ignore errors

Secrets file =/etc/rsyncd. secrets

Specify a password for rsync users

Vim/etc/rsyncd. secrets

Root: 111111

Start rsync

/Usr/local/rsync -- daemon -- config =/etc/rsyncd. conf

Client Configuration

Install rsync

Rsync -- list-only root@192.168.1.2: backup View File Information in the backup directory set by rsync

Synchronize files

Rsync-azuvP root@192.168.1.2: backup/backup

Rsync-azu -- password-file =/etc/rsyncd. password root@192.168.1.2: backup/backup

Vim/etc/rsyncd. password

111111

Chmod 0600/etc/rsyncd. password

If you want to periodically Execute

Crontab-e

20 00 *** rsync-azu -- password-file =/etc/rsyncd. password root@192.168.1.2: backup/backup>/dev/null 2> & 1

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.