rsync with excluded directories and files
rsync exclude directory | skip cache folder in backup | rsync exclude example | do not copy certain files | rsync | exclude | wordpressCaution: This command changes the system. Understand what it does before you run it.
rsync -av --exclude='wp-content/cache/' --exclude='*.log' /var/www/vhosts/example.com/httpdocs/ /backup/example.com/httpdocs/Each --exclude skips paths or files that match the pattern. A pattern containing a slash is matched against the path relative to the source, a pattern without a slash such as *.log against every file name. A trailing slash restricts the pattern to directories.
Note: Many excludes can be written to a text file (one pattern per line) and loaded with --exclude-from=DATEI. Test with --dry-run first.
Also searched as
- rsync exclude directory
- skip cache folder in backup
- rsync exclude example
- do not copy certain files