tar gz – exclude directory

You want to backup some files recursively except one directory within:

tar cvfz live_20151207.tgz --exclude='public_html/sites/all/files' public_html

it is important that the exclude is like that: –exclude=’public_html/sites/all/files’
This would FAIL:
–exclude=’./public_html/sites/all/files’

Not sure but to remember I think of it as a “text pattern”, instead of an actual path.

This entry was posted in Uncategorized. Bookmark the permalink.