News for hackers. Stuff that matters.
Re:Tracking Changes in Directories with Python by rytis on Friday December 13, 2013 @06:11AM (#6899993)
Or even use incrond [0], and get it call your script that does whatever needs to be done with the modified files.

[0] http://linux.die.net/man/8/incrond

EDIT: As a use case example I use this to detect when a new cert request is made to my Puppet master server. Once a CSR file is created, I check if the host is created by our provisioning system, and if so, then sign it.

EDIT2: This will eventually go into 3.4.0 - https://projects.puppetlabs.com/issues/7244

Re:Tracking Changes in Directories with Python by nodata on Friday December 13, 2013 @09:06AM (#6900495)
How does the puppet master get the csr unless the host has been provisioned?
Re:Tracking Changes in Directories with Python by rytis on Wednesday December 18, 2013 @02:37AM (#6926334)
The host is provisioned using some other automation tool, then when it comes up, it runs puppet agent. Puppet agent makes cert sign request (at which point csr file is created on puppet server).

Puppet server doesn't have this host in autosign.conf, so doesn't automatically sign the cert. And this is where incron kicks in and runs my script. The script queries the provisioning tool, sees that the host is in there, and runs puppet cert sign command.