Some exclude patterns work, some do not. Why?

After searching this forum a bit more I am pretty sure I found the solution from @MichaelEischer in this thread. Briefly,

If you specify wildcards on the command line without any quoting, then these are expanded by the shell before restic sees the parameters.

The correct syntax would be something like this:

restic backup --exclude "/opt/www/nextcloud/data/*.log"

Note the quotes around the file name.

And my apology to @rawtaz, using an exclude-file would have alleviated the need for quoting the wildcard-containing paths.

4 Likes