gregghz / Watcher

Watcher is a daemon that watches specified files/folders for changes and fires commands in response to those changes. It is similar to incron, however, configuration uses a simpler to read yaml file instead of a plain text file. It's also written in Python, making it easier to hack.
MIT License
245 stars 128 forks source link

Feature: add exclude/include matching to files/dirs #8

Closed mattiasr closed 11 years ago

mattiasr commented 11 years ago

When using recursive mode i bump into a problem that could be solved if you have a include/exclude matching logic

scenario: i have /repo for my yum repo whenever i add a file i want it to run createrepo -update $watched

downside, it creates a .repodata when running and then a repodata dir when done. then watcher will run createrepo on those dirs and we end up in a never ending loop. by adding some type of exclude: ['repodata', '.repodata'] or perhaps include: ['.rpm', '.xml'] we can make watcher to only look at desired files in a dir and act on that, and/or ignore events in exclude.

would be great if a feature like this could be implemented because i need it really bad.

ghost commented 11 years ago

Exclude feature added few hours ago, please test it and report back.

To have and include feature sounds good also, will see if I can implement it and send a pull request.

Sincerely.

gregghz commented 11 years ago

This was added (thanks Brunus-V), I'm going to mark this as closed. File new issues if there are any bugs found against the feature.