Skip to content

Instantly share code, notes, and snippets.

@dreiggy
Forked from macmladen/rsync.sh
Last active September 3, 2018 18:59
Show Gist options
  • Save dreiggy/c5bd1c74129e4e0d1e033cf62e795224 to your computer and use it in GitHub Desktop.
Save dreiggy/c5bd1c74129e4e0d1e033cf62e795224 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