Add option to exclude directories with a tagfile

The option is named --exclude-if-present and accepts a parameter
filename[:content]. Directories are excluded and their contents is not
backed up if they contain a file with the specified name and,
optionally, that starts with the specified content. The tagfile itself
is never excluded.

There is also a shortcut --exclude-caches that works in the same way as
the likewise-named option of tar(1): Directories are recognized as cache
if they contain a file named "CACHEDIR.TAG.

Closes #317.
This commit is contained in:
Fabian Wickborn
2017-08-19 22:44:18 +02:00
parent b46774be21
commit dbda892542
4 changed files with 189 additions and 10 deletions

View File

@@ -24,10 +24,18 @@ given as the arguments.
\fB\-e\fP, \fB\-\-exclude\fP=[]
exclude a \fB\fCpattern\fR (can be specified multiple times)
.PP
\fB\-\-exclude\-caches\fP[=false]
excludes cache directories that are marked with a CACHEDIR.TAG file
.PP
\fB\-\-exclude\-file\fP=[]
read exclude patterns from a \fB\fCfile\fR (can be specified multiple times)
.PP
\fB\-\-exclude\-if\-present\fP=""
takes filename[:header], exclude contents of directories containing filename (except filename itself) if header of that file is as provided
.PP
\fB\-\-files\-from\fP=""
read the files to backup from file (can be combined with file args)