CFEngine: little insert_lines annoyance fixed
Sometimes, crontab entries are preferable over CFEngine internal scheduling when jobs have special scheduling requirements. I have one example where a job must absolutely be started every 2 minutes. (03:20, 03:22, 03:24 and so on)
By default cf-execd is started every 5 minutes, it is ok for 03:20 with Min00, but Min22 and Min24 hard classes will never be defined while cf-execd is running, and some job occurrences never started. Cf-execd can be launched every minute, but by reducing this interval you may have to deal with lock issues. (long splaytime ?)
In such cases, an insert_lines promise to system crontab does the job, however insert_lines tries to give to regular expression metacharacters their special meaning, what is not desired:
|
|
Running the bundle:
|
|
It works, but the “Regular expression error…” message is a bit annoying, especially with many files editing promises.
A solution is to avoid special meaning characters in the crontab entry:
|
|
Not only the line is unreadable but also error-prone. Warning message is gone but the gain is not obvious.
Fortunately, this has been fixed 14 days ago in core/master branch \o/
|
|
This will certainly be part of the CFEngine 3.5 release.