Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm using incron to watch for events in a directory but I want to exclude some subdirectory or some filename PATTERNS.

Is there a way I can do this elegantly?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can't do exclusions through incrontab. You can list the files explicitly, or you can make a wrapper to filter files which you do not want to process.

A super-simple wrapper:


if ! grep -q $1 /path/to/incron.excludes
    exec /path/to/ $1
share|improve this answer
Thank you. I also received an interesting answer on stackoverflow:… – clneagu Jul 6 '11 at 8:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.