I do this with environment variables. The cron job that runs cfengine
looks like this:
30 * * * * root RUNNING_FROM_CRON=YES /usr/sbin/cfexecd -F
And then in the configs I have:
splay = ( IsDefined(RUNNING_FROM_CRON) )
SplayTime = ( 55 )
... so when it's run by hand, RUNNING_FROM_CRON is unset, the "splay"
class isn't defined, and no splaying happens.
On Tue, Nov 09, 2004 at 01:43:39PM -0500, Dave Stern wrote:
> We would like cfengine to run in two different formats yet use the same
> config file. Is this possible?
> Specifically, I'd like an interactive script to use a different value
> for SplayTime which is defined in control in the config file.
> Ideally, I'd like a command line parameter like:
> cfengine -f ... -DsPlayTime=1
> for interactive and
> cfengine -f ... -Dsplaytime=60
> for cron
> But if this can only be done by defining a class from the command line
> and having some class stanza that changes splaytime, that would be ok
> too (just work coding to set). If so, could someone show an example?
> Help-cfengine mailing list
> [email protected]
Help-cfengine mailing list