I'm trying to match filenames for a fail2ban jail - so I need to use filename globbing only - not regexes or bash scripting.
My /var/log/apache2
directory contains files including:
example.com.error.log
db.example.com.error.log
app1.example.com.error.log
app2.example.com.error.log
I'm trying to create a glob to match all files ending in .error.log
except db.example.error.log
- is this possible?
I've tried !(db)*.error.log
but this still matches db.example.com.error.log
. I'm guessing the !()
is matching no characters, allowing the *
to match from the beginning of the filename.
Note: I don't want to have to extend the glob when new appX
logfiles are added, so I can't use @()
with the list of currently-known non-db filenames.
(Background: I want to create a filter banning anyone requesting any phpMyAdmin URLs on any domain except db.example.com)