Inotify is a Linux subsystem which monitors the filesystem for changes, and provides a way to trigger actions when it does.

This is handy, since it means that your program/demon can avoid polling for changes constantly, making it more efficient and reliable. As an aside, this is how the Linux Dropbox tool works.

I was reminded of its existence by a recent hacker news article, so I decided to have a little play over lunch. Here is a little toy I hacked together which monitors a directory for text files containing URLs. When it detects a new one the script retrieves it via WGET and deposited in a nominated downloads directory.

This is a trivial use of the technology, although it is still quite useful, letting me trigger large downloads via my phone or ipad which then get automatically fetched by my NAS without the need to fire up my desktop machine.

» Visit the project on Github…

Image by Oxygen Team, used under the GPL2 licence.