
Here is a diagram of the general crontab syntax, for illustration: The rest of the line wget -O -q -t 1 basically tells the server to request a url, so that the server executes the cron script.Īnother option is to use Drupal console, for example:ģ0 * * * * /var/www/html/vendor/bin/drupal -root=/var/www/html/docroot cron:execute > /dev/null 2>&1Įxecutes cron once per hour at 30 minutes after the hour, with all output (stdout and stderr) silenced by > /dev/null 2>&1. A * is a wildcard, meaning "every time." The minimum is every one minute * * * * *. The other figures represent, respectively, hour, day, month and day of the week. The first figure represents minutes – in this case, on the "zero" minute, or top of the hour. In the above sample, the 0 * * * * represents when the task should happen. In the following example, the crontab command shown below will activate the cron tasks automatically on the hour:Ġ * * * * wget -O -q -t 1 is replaced with a URL which is different for each Drupal version. Cron configuration - Administration > Configuration > System > Cron (/admin/config/system/cron).Status report - Reports Administration > Reports > Status (/admin/reports/status).The secret URL can be found at each of these pages: For Drupal 7 and later, the URL contains a "secret key" (see below for hard-coding it) to prevent external abuse. Cron URLĮach Drupal version has a different URL, you must request for cron to trigger. This regular visit will tell Drupal to perform its periodic tasks, and this will help keep your system running smoothly. For a more active site, you might want to run that job more often-perhaps every few hours or every hour. Windows servers use a Scheduled Task to execute commands.įor a modest personal site, you might set up this cron job to run once a day. These commands are called "cron jobs." Cron is available on Unix, Linux and Mac servers. Cron is a daemon that executes commands at specified intervals.
