Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
themeRDark
OMD[mysite]:~/etc/check_mk/multisite.d/wato$ crontab -l
#
# Do not edit this file. It will be recreated each time OMD
# is started or reloaded.
#
# execute 'omd reload crontab'
# to rebuild this file out of /omd/sites/mysite/etc/cron.d/*
#
# --ENVIRONMENT------------------------------------------------
SHELL=/bin/bash
BASH_ENV=/omd/sites/mysite/.profile
OMD_ROOT=/omd/sites/mysite
OMD_SITE=mysite
PATH=/omd/sites/mysite/local/bin:/omd/sites/mysite/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin
MAILTO=""
# ------------------------------------------------------------
# /omd/sites/mysite/etc/cron.d/cmk_bulk_notify
# Needed for bulk notifcations.
...
...
...
...


Step-by-step guide

Option #1

  • create a file below /omd/sites/mysite/etc/cron.d with your new cronjob, e.g. /omd/sites/mysite/etc/cron.d/myjob

    Code Block
    languagebash
    themeRDark
    # My cronjob
    */5 * * * * $OMD_ROOT/local/myjob --params >/dev/null 2>&1


  • execute 'omd reload crontab' to rebuild this file from/omd/sites/mysite/etc/cron.d/*

    Code Block
    languagebash
    themeRDark
    root@linux:~# omd reload crontab


Option #2

  • The second possibility is to create a systemwide cronjob below /etc/cron.d, e.g. /etc/cron.d/myjob. Note the slightly different syntax: the 6th column (after the time settings) requires the user under which this cronjob is executed. Also, the environment variables $OMD_ROOT and such are not available (unless you set them explicitly in this file):


Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("site","cronjob","howto") and type = "page" and space = "KB"
labelscronjob site

...