Content Summary:
1. rsync
Rsync is a fast-track backup file tool that provides a very quick way to synchronize remote files, he only sends files in different places instead of synchronizing the entire file
Available Download URL: https://rsync.samba.org/
Some features of rsync:
1, can synchronize the entire directory or file system
2, can be synchronized soft connection, hard link, file attributes (master, group, permissions, time, etc.)
3, do not need special permissions to install the use
4. Reduce delay in transferring files
5, can use RSH,SSH or more direct socket for transmission
2. Rsync Common options
-A (--archive): r,l,p,t,g,o,d
-R (--recursive): Copy directory
-V (--vervose): Visualize
-L (--links): Keep soft connection
-P (--perms): Reserved permissions
-L (--copy-links): direct copy of the source file that the soft connection points to
--no-: Ability to turn off an option
--no-l: Remove the properties of the-l option
-Z (--compress): compression
-Z (--compress-level=num): Determines the compression level
-E "ssh-p port": Change the transport port, default 22
-P: Show details, transfer speed, etc.
-U (--update): Do not overwrite new files on the remote server than now, Mtime
--delete: Delete redundant files in remote files
--exclude=filename: Do not sync filename
--exclude-from=file: Reading unsynchronized files from a file
--BWLIMIT=100: Configuration Rate
--include: Contains files that can be used with the--exclude option, synchronizing only the specified files
--include-from=file: Read the included file from the file
The most commonly used-a-v--delete--exclude
3. Rsync Options Explained
Synchronize a folder locally
[email protected] mayang]# rsync-av/sd//tmp/mayang/
Synchronize a folder offsite
[email protected] sd]# rsync-av--delete/sd/116.211.87.242:/sd
[email protected] tmp]# rsync-av httpd-2.2.16.tar.gz [email protected]:/SD
rsync:failed to exec SSH solution appears when using rsync
Then installed the Openssh-clients
Http://www.wanvps.com/rsync-failed-to-exec-ssh.html
4. Rsync Application Example-backend service mode
Rsync is a data mirroring Backup tool under Unix-like systems
Inotify is a Linux feature that monitors file system operations such as reading, writing, and creating
Start the Rsync service
Rsync--daemon
Join to boot Boot
Echo ' rsync--daemon ' >>/etc/rc.d/rc.local
Error
1. View the server-side configuration file/etc/rsyncd.conf
@ERROR: Auth failed on module * * *
Rsync Error:error starting Client-server Protocol (code 5) at MAIN.C (1503) [receiver=3.0.6]
2. View the permissions required to synchronize directories or files requires 755
Rsync:link_stat "." (in Backup) Failed:permission denied (13)
3.ssh_exchange_identification:read:connection Reset by peer
Empty both sides iptables firewall off
Rsync+inotify implementation of real-time synchronization cases--Go
Http://www.cnblogs.com/davidwang456/p/3684945.html
Error
Http://blog.chinaunix.net/uid-13954085-id-158637.html
An example of remote disaster recovery backup system
Http://www.linuxidc.com/Linux/2012-11/74969.htm
[Data sharing] rsync synchronizes data on two servers
Http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=7156&highlight=rsync
Intotify+heartbeat+rsync realize Samba's dual-machine cluster scheme
http://more3.blog.51cto.com/9929586/1615540
To expand a post:
1. rsync error two, troubleshooting process and solution http://www.aminglinux.com/bbs/thread-7812-1-1.html
2. rsync service multiple configuration file errors wait, come on. http://www.aminglinux.com/bbs/thread-6989-1-1.html
3. Rsync synchronizes only files of the specified type http://www.aminglinux.com/bbs/thread-6676-1-1.html
4. How rsync automatically creates a directory http://www.aminglinux.com/bbs/thread-1047-1-1.html remote
5. Rsync synchronizes http://www.aminglinux.com/bbs/thread-1024-1-1.html According to a file list document
2015-04-22linux System daily Management 4