0

I configured rsnapshot, to exclude all foders containing the string docker/ in its path in the file rsnapshot_exclude

docker/* 

but now I want to include one particular folder:

/var/lib/docker/volumes/ 

How do I define this in rsnapshot.conf?

maybe define like this somehow?

docker/(?!volumes)) 

1 Answer 1

1

As rsnapshot uses rsync and passes the exclude rules to it, you can specifically include directories/files by using a '+' (include) rule.

The first rule that applies is acted on, so simply add a line

+ /var/lib/docker/volumes/ 

ABOVE your other rule.

From the rsync documentation:

Filter Rules

...

As the list of files/directories to transfer is built, rsync checks each name to be transferred against the list of include/exclude patterns in turn, and the first matching pattern is acted on: if it is an exclude pattern, then that file is skipped; if it is an include pattern then that filename is not skipped; if no matching pattern is found, then the filename is not skipped.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.