Skip to content

Configuration ​

Where alerts go, the health URL token and the list of commands not to watch are on the settings page. Everything can also be set in config/cron-guard.php, which wins over the settings page. A field set there shows a warning and can't be changed in the control panel.

php
<?php
return [
    // Settings page
    'emails' => '$CRON_GUARD_EMAILS',
    'chatWebhook' => '$SLACK_WEBHOOK_URL',
    'webhookUrl' => '',
    'healthToken' => '$CRON_GUARD_TOKEN',
    'ignore' => ['help', 'up', 'on', 'off', 'install/*', 'setup/*', 'migrate/*', 'project-config/*', 'plugin/*', 'clear-caches/*', 'cache/*', 'queue/listen', 'cron-guard/*'],

    // Config file only
    'schedules' => [
        'db/backup' => '1 day',
        'feed-me/feeds/queue --id=3' => '6 hours',
    ],
    'watchInteractive' => false,
    'keepDays' => 30,
    'remindHours' => 24,
    'stuckMinutes' => 60,
    'checkFromWeb' => true,
    'emailTemplate' => '',
];

Settings ​

SettingDefaultWhat it does
emailsAddresses alerts are emailed to, one a line or separated by commas.
chatWebhookA Slack, Discord or Microsoft Teams incoming webhook URL.
webhookUrlA URL alerts are posted to as JSON.
healthTokenTurns on the health URL. Empty keeps it off.
ignoreDeploy and setup commandsCommands not watched, with * for any part. See What's watched.
schedules[]Fixed schedules, by command or route, as seconds or a string like '1 day', for commands whose schedule shouldn't be learnt.
watchInteractivefalseAlso watch commands typed in a terminal.
keepDays30Days of runs kept. At most 1,000 runs a command are kept either way.
remindHours24Hours before a problem that's still there is sent again. 0 sends it once.
stuckMinutes60Minutes a run may take before it counts as stuck, unless it usually takes longer.
checkFromWebtrueRun the check after control panel and site requests too, at most every five minutes.
emailTemplateA site template for alert emails, in Twig or MJML. See Email Templates.

When to set a schedule yourself ​

Learning works for anything that runs at regular times. Set a schedule in schedules when:

  • a command runs rarely, such as weekly, and you don't want to wait four weeks for it to be learnt;
  • a command's runs vary a lot, so it shows as Irregular, but it should still run at least this often.