rsync remote data synchronization

reference:

https://man.linuxde.net/rsync

https://zhiqiang.org/coding/rsync-will-not-compare-file-content.html

https://www.cnblogs.com/f-ck-need-u/p/7220009.html

 

grammar:

rsync [OPTION]... SRC DEST
rsync [OPTION]... SRC [USER@]host:DEST
rsync [OPTION]... [USER@]HOST:SRC DEST
rsync [OPTION]... [USER@]HOST::SRC DEST
rsync [OPTION]... SRC [USER@]HOST::DEST
rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]

 

Mirror rsync achieve synchronization (one):

rsync -avz --progress --delete work@172.16.78.192:~/a/ ~/b/
rsync -avz --progress --delete ~/b/ work@172.16.78.192:~/a/

 

Automatic password synchronization is:

sshpass -p "xxxx" rsync -avz --progress --delete work@172.16.78.192:~/a/ ~/b/
sshpass -p "xxxx" rsync -avz --progress --delete ~/b/ work@172.16.78.192:~/a/

 

Exclude parameter file used:

--exclude = PATTERN exclude the specified file mode of transmission is not required.
--include = PATTERN do not exclude the need to specify the file transfer mode.
--exclude-from = FILE exclude file FILE specified pattern.
--include-from = FILE FILE, does not exclude that match the specified pattern.

 

File mode:

https://www.cnblogs.com/lixuwu/p/7816335.html

 

Guess you like

Origin www.cnblogs.com/jacen789/p/12347409.html