	cfcron vers. 1.3 

cfcron is a wrapper script, which helps using CFengine from within
cron. The output of a CFengine run will be mailed to the sysadmin only
if it has changed, at least once a day. This script is more or less
based on cfwrap which was written in perl by Mark Burgess. But I don't
have perl around on all platforms, so I needed a shell script. Also
this script has some features which are not found in cfwrap.

Before using cfcron you should adopt some variables at the
beginning of the script (pathes etc.)

I think a short example will describe the usage best.

Suppose you have your cfengine scripts in a central repository
which you mount to different hosts by NFS, let's say 
/usr/local/etc/cfe. You might consider to put cfcron in
/usr/local/etc. Now you can put an entry into all the crontab's 
on all that hosts like this:
11 * * * * [ -x /usr/local/etc/cfe/cfcron ] && /usr/local/etc/cfe/cfcron

This entry will run CFengine ones per hour and mail you the
results (if they have changed). Everything normal until here.
But if you want to stop running CFengine on all hosts (e.g. for
some testing) you normally have to rename the script or remove the 
crontab entries. Another way is the one I use in this script: there
is a global stop file, "noconf" e.g. in /usr/local/etc/cfe. This
file prohibits the running of CFengine if it exists. So for the
example above you just have to do a "touch /usr/local/etc/cfe/noconf"
and you are done, cfcron will exit silently from now on.

Sometimes you might want to stop the execution of CFengine on just
one host. For that reason (and for those guys starting every script
lying around ;-) cfcron uses another file which permits the running 
of CFengine. It looks for a file named ".ok" in the current directory,
which is if cfcron is run by cron the homedir of the crontab owner
(in most cases root). But if cfcron is started accidently, one will
(hopefully) not be in the home directory. So this mechanism might be
helpful to avoid running a complete CFengine job by mistake. If the
ok file does not exist cfcron will send a mail that it is disabled.

In system administration CFengine does a great job, but it could be
pretty dangerous too, cause it can do a lot of damage if not used
careful, especially if you let it run by cron. With those
possibilities described above it might be a bit more safely to let it
run automatically on a bigger no. of hosts.

So many words for such a small script...

Uwe Sievers, <uwe@dwelle.de>, 1998
