Rsync Detailed Configuration Instructions

Source: Internet
Author: User
Tags comparison table rsync

Rsync is a data mirroring Backup tool under Unix-like systems.

It has the following characteristics:
The entire directory tree and file system can be saved in a mirror.
It is easy to keep the original file permissions, time, soft and hard links and so on.
Install without special permissions.
Fast: When you synchronize for the first time, rsync copies the entire content, but only the modified files are transferred the next time. Rsync can compress and decompress in the process of transmitting data, so it can use less bandwidth.
Security: You can use SCP, SSH and other means to transfer files, of course, you can also through a direct socket connection.
Support anonymous transmission, to facilitate the site mirror image.


The installation of rsync, thecentos default has already installed the program. No installation required.

Preparation: Check if Rpm-qa rsync is already installed
1. Installation
Yum Install rsync

2. Command input
Rsync

The following appears to indicate that the installation was successful:
Rsync version 3.0.6 protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site:http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
Socketpairs, Hardlinks, symlinks, IPv6, Batchfiles, InPlace,
Append, ACLs, Xattrs, Iconv, Symtimes


Rsync uses the server-client synchronous text
Dual-Machine Backup configuration:
Service side:
There are many tutorials on the web using XINET.D to start the rsync server.
This uses rsync to bring up the server.
such as: Rsync--daemon--config=/home/leyewen/etc/rsync/rsyncd.conf

1, configuration rsyncd.conf as follows: # Global parameters
# users running the rsync daemon
UID = root
# groups running the rsync daemon
GID = root
# Do not use Chroot
Use chroot = no
# Maximum number of connections is 4
Max connections = 2
# Whether to check the permissions of the password file
Strict modes = yes
# default Port 873 It's better to change to more than 1024 ports and
Port = 873
#pid文件的存放位置
PID file =/usr/local/rsync/rsyncd.pid
#锁文件的存放位置
Lock file =/usr/local/rsync/rsync.lock
Log file =/usr/local/rsync/log/rsyncd.log
MOTD file =/USR/LOCAL/RSYNC/RSYNCD.MOTD

# module Parameters
# This is a certified module name that needs to be specified on the client side
[Backup]
# directories that need to be mirrored are indispensable
Path =/home/rsync/data
# Note Information for this module
Comment = My Backup
# Some unrelated IO errors can be ignored
Ignore errors
# read-only
Read Only = no
# Do not allow column files
List = no
# authenticated user name if not, it's anonymous. This user is not system-independent--->Auth users here = same as user names in Rsync.pass
Auth users = Sensor
# Password and username comparison table, password files generated by themselves
Secrets file =/usr/local/rsync/rsync.pass
# Allow host
# hosts allow = 192.168.1.1,10.10.10.10
# Disable Host
# hosts Deny = 0.0.0.0/0
#transfer logging = yes




2, configure the rsync password (in the above configuration file has already written the path)/usr/local/rsync/rsync.pass (name casually write, as long as the same as in the above configuration file), format (one user) account number: password
Vi/usr/local/rsync/rsync.pass
Example:
sensor:passwd
Permissions: Because Rsync.pas stores the user name and password for the rsync service, it is important. To set Rsync.pas to root, with a permission of 600.
chmod 600/usr/local/rsync/rsync.pass

3. Start the rsync server
Rsync--daemon--config=/usr/local/rsync/rsyncd.conf


Client:
Rsync-avz--progress--delete--port=873--password-file=/home/leyewen/etc/rsync/rsync-client.pass--exclude=.svn/--exclude=web-inf//home/leyewen/svn/* [email protected] :: Back

This synchronizes all the files from the local SVN to the server-side configuration backup directory.
--exclude=.svn/--exclude=web-inf/filtering svn and Web-inf directories

Configuration Instructions rsync-avz/home/rsync/data/* [email protected]::backupRsync-avz Sync Directory | file user name @ip:: module name-a parameter, equivalent to-rlptgod,-r is the recursive-L is a linked file, which means to copy the link file;-p to maintain the original file permissions;-T to keep the file original user group;-O Keep the original owner of the file;-D is equivalent to the block device file;
-Z compression during transmission;
-P transmission progress;
-V Transfer progress and other information, and-p a little relationship, try it yourself. You can read the documentation, PLUS: Custom welcome information files RSYNCD.MOTD such as: [[email protected] rsync]# cat RSYNCD.MOTD
+++++++++++++++++++++++++++
+ Wellcome Rsyncd +
+++++++++++++++++++++++++++ Note:--password-file=/home/leyewen/etc/rsync/rsync-client.pass Specify password file via--password-file, 1, note modify. pass file is chmod 600 2,rsync server format is usrname:pwd but the client format is PWD, so error prone here!!

Rsync Detailed Configuration Instructions

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.