diff --git a/examples/example.borg b/examples/example.borg index 1ea48abcf4e10c6703bb6d6f23d8a4b362c7d0b4..244dbc8b44557dcc80f3b2115c80fe06730df6ec 100644 --- a/examples/example.borg +++ b/examples/example.borg @@ -74,6 +74,16 @@ exclude = /var/lib/mlocate exclude = /var/lib/postgresql exclude = /var/lib/mysql +## exclude directories that contain a CACHEDIR.TAG file +## +## Default: +# excludecaches = no + +## exclude files flagged NODUMP +## +## Default: +# excludenodump = no + ###################################################### ## destination section ## (where the files are copied to) diff --git a/handlers/borg.in b/handlers/borg.in index 3a8c0481470214ea3f916de0533e4e00e6fec60a..d1c8a7802383523e39fcaaf174342828f5867636 100644 --- a/handlers/borg.in +++ b/handlers/borg.in @@ -30,6 +30,8 @@ getconf keepweekly 4 getconf keepmonthly -1 getconf include getconf exclude +getconf excludecaches no +getconf excludenodump no setsection dest getconf user @@ -123,6 +125,14 @@ if [ ! -z $bwlimit ]; then execstr="${execstr} --remote-ratelimit=${bwlimit}" fi +if [ "$excludecaches" == "yes" ]; then + execstr="${execstr} --exclude-caches" +fi + +if [ "$excludenodump" == "yes" ]; then + execstr="${execstr} --exclude-nodump" +fi + # include client-part and server-part execstr="${execstr} ${excludes} $execstr_repository::$execstr_archive ${includes}" debug "$execstr"