0

I'm creating an exclude rule for bacula so it doesn't take care of some cache and temporary uploads folders inside a filesystem. But I'm failing to write it

Suppose this filesystem

/filestore/user1/
/filestore/user1/uploads
/filestore/user1/user_files/uploads
/filestore/user2/uploads
/filestore/user1/user_files/

Main backup rule says

File = /filestore

And exclude rule

wilddir = "/filestore/*/uploads/

But will match all "uploads" folders. Is there any simple way/wildcard/regex to match only the first level uploads folder. To be clear:

/filestore/user1/uploads #match
/filestore/user1/user_files/uploads # not match
/filestore/user2/uploads #match
fission
  • 3,601
  • 2
  • 21
  • 31
Gonzalo Cao
  • 111
  • 1
  • 5

1 Answers1

1

Finally I found it, you can do it with regexp but in this particular case you have to ensure that work with Bacula

  regexdir = "/filestore/[^/]+/uploads"
  regexdir = "/filestore/[^/]+/cache"

instead of using Wilddir which only works with wildcards. Bacula documentation says using regexp is less efficient but mandatory in this case.

There's a very useful command called "bregex" that allow you to test bacula regex engine without having to go through the full scheduling process.

I will edit Question title to make it clear for other people that could be interested in.

Gonzalo Cao
  • 111
  • 1
  • 5