Skip to content

Instantly share code, notes, and snippets.

@macmladen
Last active August 11, 2023 22:43
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save macmladen/75817cc47f4ddf0a18f0 to your computer and use it in GitHub Desktop.
Save macmladen/75817cc47f4ddf0a18f0 to your computer and use it in GitHub Desktop.
rsync exclude patterns
# /dir/ means exclude the root folder /dir
# /dir/* means get the root folder /dir but not the contents
# dir/ means exclude any folder anywhere where the name contains dir/
# Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
# /dir means exclude any folder anywhere where the name contains /dir
# Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
# /var/spool/lpd//cf means skip files that start with cf within any folder within /var/spool/lpd
#
# include, +
# exclude, -
#
# '*' matches any non-empty path component (it stops at slashes).
# '**' to match anything, including slashes.
# '?' matches any character except a slash (/).
# '[' introduces a character class, such as [a-z] or [[:alpha:]].
# in a wildcard pattern, a backslash can be used to escape a wildcard character, but it is matched literally when no wildcards are present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment