2018-1-30 Linux Learning Notes

Source: Internet
Author: User
Tags rsync

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
    • Rsync synchronization can be divided into two ways: SSH synchronization and service mode synchronization.
    • Rsync syncs via SSH
      Rsync-av test1/192.168.206.135:/tmp/test2/
      Rsync-av-e "Ssh-p" test1/192.168.206.135:/tmp/test2/

    • Rsync is synchronized by service
      To edit a configuration file/etc/rsyncd.conf
      Start Service rsync--daemon
      Format: Rsync-av test/192.168.206.135::module/dir/

2018-1-30 Linux Learning Notes

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.