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.