Advanced

Scheduling jobs based on filesystem activity with incron

Posted by Scott_Ruecker on · 3 comments
Linux.com; By Shashank Sharma
Mail this story
Print this story

There are numerous documents, tutorials and guides detailing the workings and usage of cron, the de facto tool for scheduling jobs on Linux. While traditional cron jobs are executed at set times, inotify cron, or incron, is a cron clone that watches the filesystem for specified changes and executes the relevant commands. You can set incron to monitor a particular file or directory for changes and schedule jobs for when those changes occur. Fedora users can use yum to install incron with the yum install incron command. Once installed, you need to start the incron daemon before you can schedule jobs. The command, service incrond start, executed as root, will start the incron daemon on and the chkconfig incrond on command will configure it to be started at boot time.

Full Story

  Nav
» Read more about: Story Type: News Story; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (3)

I looked at different ways of utilizing the inotify kernel interface for a requirement I had, namely to monitor directories on an vsftpd server for a customer who wanted notification whenever anything happened with files.

Of all the alternatives, incron was the least work - I just had to write some simple shell scripts to send the emails when fired off by incron. The other approaches all required having long running shell scripts or c programs and would have required more work and debugging to set something up.
It sounds great, but it's too bad it doesn't work recursive. I'd love to be able to set a trigger on a single directory (e.g. my music collection) and have it fire an "mpc update" whenever anything inside there changes.
> It sounds great, but it's too bad it doesn't work recursive.

That's my only gripe with it...

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post