Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Puppet has the cron resource for managing the crontab, but is there a similar way of managing incrontab? I can find no writings anywhere regarding this, and to be fair, I'm extremely new to puppet (software dev helping out an overworked sysadmin).

share|improve this question

2 Answers 2

up vote 3 down vote accepted

There is no native support for incron but that doesn't mean you can't write a simple defined type that manages the tabs in /etc/incron.d. These would be just file resources for which Puppet has of course native support. Depending on your specific needs you could also make that defined type more complex by adding support for per-user incrontabs. These would probably require use of the Concat module.

But have a look at http://docs.puppetlabs.com/learning/definedtypes.html first for more info on defined types. Could be that's all you need.

share|improve this answer
    
excuse my ignorance, but I have an incron line added to the incrontab, but nothing at all in /etc/incron.d/ .. if a file with a single line is added to the incron.d folder, should it load up as an incrontab ? –  Josh Smeaton Sep 28 '12 at 7:05
1  
Yes, system incrontabs are loaded and watched by incrond. I don't personally use or know much of incron, I just read linux.die.net/man/5/incrontab which states that system incrontabs are in /etc/incron.d and user incrontabs are created by means of incrontab and put in /var/spool/incron. So your Puppet type/module would put system incrontabs in /etc/incron.d and a user's incrontab in /var/spool/incron/<username>. –  daff Sep 28 '12 at 8:51

I've found a incron module at https://github.com/duritong/puppet-incron.

I have a pending pull request that adds a incron::watch defined type. It's working fine for me so far.

share|improve this answer

Your Answer

 
discard

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.