Basic rsync command syntax
Rsync Command Option source directory target directory
If the source directory is/var/www/, all the files in the directory will be synchronized to the target directory. If it is/var/www /*, the hidden file in the current directory (the folder name or file name is ". but the hidden files in the subdirectories will still be synchronized.
If you want to exclude a file (or folder), you can use-Exclude. For example, to exclude the dir1 folder under the source directory, you can write it:
/Usr/bin/rsync-vzrtopg-exclude = dir1/var/www/src // var/www/destMultiple Entries can be excluded at the same time, for example:
/Usr/bin/rsync-vzrtopg-exclude = dir1-exclude = dir2/var/www/src // var/www/destIn addition to the above method, you can also use-Exclude-from:
/Usr/bin/rsync-vzrtopg-exclude-from = exclude. list/var/www/src // var/www/destThe exclude. list file specifies the list to be excluded, for example:
Dir1
[0-9] *
Dir2/. [a-z0-9] *
. SvnIt means to exclude all files and folders named by numbers in the/var/www/dir1,/var/www directory, hidden files under the/var/www/dir2/directory, and/ var/www directory all. svn folder, including. svn folder.
Note: Both exclude and exclude-from have two minus signs. If one is missing, the command line will not report an error, but the executed files or folders cannot be excluded.