Use the rsync command to synchronize the specified file configuration

Source: Internet
Author: User
Tags rsync

Sometimes all files need to be synchronized to the specified directory, including subdirectories.

Confirm the file name to be synchronized before execution.

# Rsync-avmn -- include = '*/' -- include = '*. pdf' -- exclude = '*'/SRC // DEST/

The execution results of the following two commands are the same. The specified files under the SRC Directory (all PDF files, including subdirectories) are synchronized to the DEST directory, but the empty directory is not synchronized.

# Rsync-avm -- include = '*/' -- include = '*. pdf' -- exclude = '*'/SRC // DEST/
# Rsync-avm -- include = '*. pdf'-f' hide ,! */'/SRC // DEST/

Synchronize new files.

# Rsync-avmu -- include = '*/' -- include = '*. pdf' -- exclude = '*'/SRC // DEST/

Option Explanation
- Archive: transfers files recursively and maintains all file attributes.
-V Displays synchronization information. Up to three values can be specified.
-M Do not synchronize empty directories
-N Check the synchronization File (dry-run) before executing the synchronization)
-U Synchronize new files

-Include = '*/' is the synchronization Directory,-include = '*. pdf' is the synchronous pdf file, and-exclude = '*' is to exclude all files from the synchronized object.

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.