10.28 Rsync Tools Introduction
- The rsync command is a remote data synchronization tool that allows you to quickly sync files between multiple hosts via Lan/wan. Rsync uses the so-called rsync algorithm to synchronize files between local and remote two hosts, which only transmits the different parts of two files . Rather than the whole transfer every time, so it's pretty fast.
- rsync format:
Rsync[option] ... SRC DEST//synchronization of local machines
Rsync[option} ... SRC [[Email protected]]host:dest//Using a remote shell program (e.g. RSH/SSH) to copy the contents of the local machine to a remote machine
Rsync[option] ... [[Email protected]]host:src DEST//Using remote shell programs (such as RSH/SSH) to copy the contents of the remote machine to the local machine
Rsync[option] ... [[Email protected]]host::src DEST//Copy files from the remote rsync server to the local machine (start this mode when the path information contains "::" delimiter)
Rsync[option] ... SRC [[Email protected]]host::D est//Copy files from the local machine to the remote rsync server
For example:
Rsync-av/etc/passwd/tmp/1.txt
Rsync-av/tmp/1.txt 192.168.206.135:/tmp/2.txt
10.29/10.30 rsync Common Options
- Rsync Common options:
-A contains-rtplgod
-r Sync Directory with the-R option similar to CP
-V Display information when synchronizing, let us know the process of synchronization
-L Keep Soft links
-L plus this option, synchronizing the soft links will synchronize the source files
-P Keep File permissions property
-O Keep File owner
-G hold file of the genus Group
-D Keep Device file information
-T keep file Time properties
--delete Delete files in dest that are not in SRC
--exclude filter the specified file, such as--exclude "logs" will be the file name contains logs files or directories filtered out, not synchronized
-P shows the synchronization process, such as rate, more detailed than-V
-U plus this option, if the file in dest is newer than SRC, it is out of sync
-Z Compression during transfer (to reduce bandwidth consumed during transmission)
10.31 rsync sync via ssh
2018-1-30 Linux Learning Notes