Rsync installation and configuration

Source: Internet
Author: User
Tags rsync
System: Fedora12 install rsync: Yuminstallrsyncvietcxinetd. drsyncdisableno -------- changetoyes read: Use Rsync auto sync tool in Debian and Fedora http: www.linuxidc.comLinux2011-0840819.htm server related configuration 1. Create three files in etc

System: FEdOra12
Install rsyNc: Yum install rSync
Vi/etc/xinetd. d/rsync
Disable = no <---------- change to yes

Related reading:Http://www.linux using Rsync automatic synchronization tool under Debian and FedoraIdC.com/Linux/2011-08/40819.htm

Server-related configuration
1. Create three files under/etc/
RsynCd. Conf rsyncd. motd rsyncd. secrets
 
2. Configuration File
Vi rsyncd. conf
MotdFile=/Etc/rsyncd. motd # Welcome File
Read only = no
List = yes
Uid = root # You can create a backup user or use root. The default value is nobody.
Gid = root
Use chroot = no # yes by default (requires the root to run rsync) for additional security protection
# Hosts allow = 192.168.0.61
# Hosts deny = 192.168.128.0/24
Max connections = 2 # set the number of connections to 2. The default number of connections is unlimited.
Log file =/var/log/rsyncd. log
Pid file =/var/run/rsyncd. pid
Lock file =/var/run/rsyncd. lock
# Define dirctory for rsync
[Test] # module: rsync Client
# Comment = nagios's directory from 192.168.0.61
Path =/var/www/ExAmple_com/dl01/pub # document directory to be backed up
Secrets file =/etc/rsyncd. secrets # password to store files
Auth users = test # connection account. It has nothing to do with the system account. This account must exist on the server.
Read only = no
 
3. Welcome File
[Root @ localhost test] # vi/etc/rsyncd. motd
Welcome to use the test rsync services!
 
4. Password File
[Root @ localhost test] # vi/etc/rsyncd. secrets # The Password File Permission is 600. This step must be set
Test: test
5.Chmod600/etc/rsyncd .*
6. Run rsync
Rsync -- daemon/etc/rsyncd. conf
Rsync path: rsync configuration file
 
Client Configuration
1. a) install the rsync package ---- yum install rsync
B) Create a password file
[Root @ localhost ~] # Vi/etc/rsyncd. secrets
Test # client password is not required
Note: The password must be consistent with the password in the rsync server password file and should be the rsync client password.
C) chmod 600/etc/rsyncd. secrets ---- Modify permissions
If this step is not completed, the following message is displayed:
Password file must not be other-accessible
Continuing without password file
Password:

2. synchronous connection test
[Root @ mail pub] # rsync-vzrtopg -- progress -- delete -- password-file =/etc/rsyncd. secrets test@192.168.0.61: test/var/www/example_com/dl01/pub/
Refreshing incremental file list
./
Test.txt
0 100% 0.00kB/s 0:00:00 (xfer #1, to-check = 0/2)
 
Sent 78 bytes encoded ed 150 bytes 152.00 bytes/sec
Total size is 0 speeDuP is 0.00
[Root @ mail pub] #Ls
Test.txt

Test successful

3. Implement timed synchronization. Assume that synchronization is performed.

Vim crond. rsync
00 2 *** rsync-vzrtopg -- progress -- delete -- password-file =/etc/rsyncd. secrets test@192.168.0.61: test/var/www/example_com/dl01/pub
CrontabCrond. rsync
Crontab-e editing now has crontab
Crontab-l
 
Complete

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.