How do I specify a wildcard string for the end/trailing of a folder

Question

I want to only match wildcard folders but not wildcard files.
**/*cache or even **cache works for folders prepended with cache
but
**/*cache*/ doesn’t work to match only folders because the trailing / is ignored
Is there anyway to get around this?

Reference

From Documentation https://restic.readthedocs.io/en/latest/040_backup.html
A trailing / is ignored, a leading / anchors the pattern at the root directory. This means, /bin matches /bin/bash but does not match /usr/bin/restic.

Welcome here @Unequal8761 !

The ignore system makes no distinction between files and directories. The patterns you specify are checked against files and directories alike.

Does that mean restic checks the file path of every file in the provided directory regardless of exclude?

Some more context. I get error:

incomplete metadata for C:\ProgramData\Dropbox\Update\Log\DropboxUpdate.log-2025-04-20-05-45-16-090-12840:

even thought I have \ProgramData\Dropbox in my excludes

@Unequal8761, for that example your exclude should be C:\ProgramData\Dropbox so with the drive letter included.

Note that restic is case sensitive so also use the same case (I recommend all in uppercase) for the backup command drive letters..

1 Like

For my own sanity. I tested it.

@Unequal8761
since your original question was:

I want to only match wildcard folders but not wildcard files.

Can you help summarize your findings, if it helped anything towards your question?
Do I observe correctly that since there are 8 folders in your example tree, all green exclude combinations would work for you?