Simple application of rsync in Linux and Rsync+inotify real-time application

Source: Internet
Author: User
Tags file system inotify file permissions rsync backup linux

This article System Centos6.0

Server: (Centos) 192.168.182.130

Client: (LV2) 192.168.182.129

Rsync is a data mirroring Backup tool under Unix-like systems, and--remote sync can be seen from the name of the software.

Its characteristics are as follows:

Can be mirrored to save the entire directory tree and file system.

It is easy to maintain the original file permissions, time, soft and hard links and so on.

can be installed without special permissions.

Fast: Rsync replicates all content on the first synchronization, 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 the SCP, SSH and other means to transfer files, of course, can also be connected through a direct socket.

Support for anonymous transmission, to facilitate the use of Web site mirror image.

Server-side Startup

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

Root permissions may be required to run.

/etc/rsyncd/rsyncd.conf is the location of the rsyncd.conf you just edited.

can also be added to the/etc/rc.d/rc.local to allow the system to automatically start and so on.

Client synchronization

rsync-Parameter user name the contents of the square brackets (module name) in the ip::rsyncd.conf of the @ synchronization server are stored locally as:

Rsync–vzrtopg–delete--progress--exclude "*.log" Lansgg@192.168.182.130::lansggtest/root/backup--password-file=/ Etc/rsyncd.pass

The interpretation of the order is as follows:

-V---verbose display details of transmission

-Z to compress files when--compress transfer

-R--recursive recursively processing of subdirectories

-T is-times keep file time information

-O--owner is used to maintain the owner information of the file

-P---perms Keep file permissions

-G-–group keep file group information

-A is the--archive archive mode, which represents the transfer of files recursively and maintains all file attributes equal to the-rlptgod

--delete keeps data synchronized with the Rsync server, and if the server deletes a file, the client will delete it.

The--progress shows detailed progress.

--exclude is used to exclude unwanted file types.

LANSGG@192.168.182.130::LANSGGTEST specifies the server to be backed up and the associated module, LANSGG the rsync synchronization account that is set up on the servers server;

/BACKUP specifies where the backed up files are stored on the client.

--PASSWORD-FILE=/ETC/RSYNCD.PASS Specifies the location where the client holds the password file.

rsync simple Application;

This column more highlights: http://www.bianceng.cn/OS/Linux/

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.