Rsync, a data Image Backup tool in Linux

Source: Internet
Author: User
Tags man rsync
1. what is rsyncrsync? remotesynchronize is a software that implements remote synchronization while synchronizing files, you can retain additional information such as the permission, time, and soft/hard link of the original file. Rsync uses the & ldquo; rsync algorithm & rdquo; to provide a customer

1. what is rsync?

Rsync, remote synchronize is a software that implements remote synchronization. it can keep the permissions, time, soft and hard links, and other additional information of the original file while synchronizing files. Rsync uses the "rsync algorithm" to provide a fast way to synchronize files between clients and remote file servers. It can also transmit files through ssh, which ensures high confidentiality, in addition, it is free software.

Rsync includes the following features:

Update the entire directory and tree and file system;
Optional maintenance of symbolic chains, hard links, files belonging to, permissions, devices, and time;
No special permission requirements are required for installation;
For multiple files, the internal pipeline reduces the latency of file waiting;
You can use rsh, ssh, or direct port as the transfer port;
Supports anonymous rsync file synchronization and is an ideal image tool;

2. rsync installation. Common method: yum install rsync

3. configuration file of rsync server

cat /etc/rsyncd/rsync.conf # Distributed under the terms of the GNU General Public License v2# Minimal configuration file for rsync daemon# See rsync(1) and rsyncd.conf(5) man pages for help# This line is required by the /etc/init.d/rsyncd scriptpid file = /var/run/rsync.pidport = 873#address = 192.168.1.171#uid = nobody#gid = nobodyuid = rootgid = rootuse chroot = yesread only = no#limit access to private LANshosts allow=*#hosts deny=*max connections = 5motd file = /etc/rsyncd/rsync.motd#This will give you a separate log file#log file = /var/log/rsync.log#This will log every file transferred - up to 85,000+ per user, per sync#transfer logging = yeslog format = %t %a %m %f %bsyslog facility = local3timeout = 300[data]path = /data1list=yesignore errorsauth users = rootsecrets file = /etc/rsyncd/rsync.secretscomment = rsync data1 dir#exclude = beinan/ samba/[garbagekrc]path = /data1/garbagekrclist=yesignore errorsauth users = rootsecrets file = /etc/rsyncd/rsync.secretscomment = rsync garbagekrc dir

User password file:

cat /etc/rsyncd/rsync.secrets root:test123

The username must be an existing user on the server.
4. start The rsync service:/usr/bin/rsync -- daemon -- config =/etc/rsyncd/rsync. conf

5. back up files to the server:

Rsync-az -- password-file = rsync. password jsoncpp/* root @ IP: data/mydata/

Password-file can specify the password.

6. rsync can also pull files from the server to the local device. You can use crontab to implement timed synchronization.

7. For more information, see man rsync.

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.