Ubuntu – How to exclude all hidden files and folders from duplicity backup

duplicity

How can I set duplicity to exclude all hidden files and folders from backing them up, without specifying each and every one of them?

Best Answer

A hidden file or directory starts with a dot (e.g. .bash_history, .cache/). The pattern for that is .*, so you can use the --exclude '.*' option to exclude hidden files and directories. This option must come before other --include patterns because:

A given file is excluded by the file selection system exactly when the first matching file selection condition specifies that the file be excluded; otherwise the file is included.

(from man duplicity)