Forum: CFEngine Help
Subject: inserting lines into crontab
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,23442,23442#msg-23442

(cfengine 3.1.4)

Imagine a set of related but different machines being maintained by cfengine.  
Each has its own root crontab with contents that may be somewhat different, for 
legitimate reasons.  This request is NOT about those differences, but the 
differences act as a possible constraint on the real question.

We would like to be able to maintain a some sort of common repository of 
additional crontab entries, ideally a mini-crontab file itself, that could be 
installed and maintained by cfengine into each of those machines.  How can we 
do that?

I suspect I need to be in the vicinity of ref. manual "7.7.2 insert_type" with 
that type being "file".  But the description is poor, and the example woefully 
incomplete (I've filed bug 793 about this).

Could I use a template-like file, say, "crontab.local-entries"?  Something like:
==========
# crontab-local-start
* * * * * first common command
* * * * * second common command
# crontab-local-end
==========

I've included the possibility of commented delimiters, as a pair of section 
markers, if this would help.

Can cfengine now insert that (and maintain future changes to it) into the 
various, possibly different, crontab files on the various machines?  If so, 
could someone give a clue as to what the cfengine code would look like, please?

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to