Forum: CFEngine Help Subject: Re: inserting lines into crontab Author: davidlee Link to topic: https://cfengine.com/forum/read.php?3,23442,23466#msg-23466
Neil: Thanks for your second reply. What my team members would like is the capability simply to maintain a centralised repository of crontab-like snippet files. This has great merit from the simplicity standpoint. These will get installed onto a variety of different machines with different functions, so those snippets will somehow need integrating into each system's own cron functions. And I have to say that I very much sympathise with this viewpoint. I believe in cfengine! So I would fully envision using each machine's cfengine to import (perhaps selectively) those snippet files and insert them into that machines own cron functionality. But what we are trying to avoid is having to write the cron entries deep in the murky depths of cfengine syntax, when a file repository sitting alongside those cfengine files will be just as clean, and a lot more comprehensible. (Contrast the visual shock of, for example, Ryan's method with the elegance of a one-line file snippet (three lines if you include possible start and end markers. ) I believe in cfengine! But that's not the same as thinking "because I have this great hammer, therefore I have to coerce every single detail of every single problem to look like a nail". Rather I'm thinking "because I have this great Swiss-army penknife, I should use the right tools in the right places". And for us, that would the simplicity of writing crontab-like file snippets as files (unencumbered by the complexity and therefore error-dangers of writing cfengine scripts for each line of each crontab), and asking cfengine to promise to maintain those into the target systems. Mike's earlier suggestion of "/etc/cron.d" looks very good. I've just written and tested the cfengine scripting to do this. It installs such snippets and maintains changes to them. All under the control of cfengine. Ryan: Thanks for the idea. As discussed above, my team members (including me!) reckon it is much cleaner (the KISS principle) to maintain file snippets if reasonably possible. And i think the method I have outlined is fully conformant with cfengine principles, isn't it? _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine