Uses for crontab

The crontab is used to run several cron jobs inside the GroundWork container set. These are useful for Network Discovery and Business Services Monitoring (BSM) operations, as well as reporting and archival. This is an advanced feature.

Changing Existing cron Jobs 

You can make changes to the existing crontab using Entrypoint scripts. This process is described in detail on the Configuring NeDi page. You should never modify the default crontab directly, as this file will almost certainly be replaced on upgrade. Instead, either add your own cron jobs as described below, or make idempotent entrypoint scripts to edit the default crontab for your purposes. 

Adding Your Own cron Jobs 

You can add cron jobs to the file /usr/local/groundwork/config/cron.customer.crontab, which is accessible via the monarch or nagios containers. For example:

cd gw8
docker-compose exec nagios vi /usr/local/groundwork/config/cron.customer.crontab

will allow you to edit the crontab and set up your own jobs. Be aware, however, that the way cron is used in a Docker context, and in a micro-services application such as GroundWork Monitor is very different from the way it is used in a typical Linux host. In this case, cron jobs typically execute ephemeral containers that perform their functions and then vanish. See the default GroundWork crontab for examples, and make sure you understand how to use ephemeral containers before launching your own cron jobs. 

Timezone for cron

The time zone that the crontab runs in is set at installation, and tracked in the gw8.env file. You can see the timezone cron uses from the command line like this:

cd gw8
$ cat gw8.env | grep GW8_TZ

If you want to change the cron timezone, you can do so by editing this file and restarting GroundWork. 

Related Resources