By bluepuma on
Hi there,
I put Drupal offline for site maintenance but it seems that the cron job can still be run by accessing cron.php.
When fiddling with the Drupal site and code of course I don't want the cron job to be executed.
So my question: Should the cron job page always be disabled when Drupal is off-line or should the site maintanance page have at least an option to do so?
Cheers
Mike
Comments
maybe
maybe you can just rename the cron.php in your directory with a different name, so the cron job cannot be run from outside.
In Drupal 7 you can go to
In Drupal 7 you can go to admin/config/system/cron/settings
and disable cron tasks.
In case you run across this
In case you run across this from a search looking for info about Drupal 8, it's worth noting that there is a cron access check which denies cron access if the site is in maintenance mode: https://git.drupalcode.org/project/drupal/-/blob/8.8.x/core/modules/syst.... It appears this is only used when attempting to trigger the cron from a URL, see https://git.drupalcode.org/project/drupal/-/blob/8.8.x/core/modules/syst.... I did not test to see if this works as I would expect.
Drush's stance is that the decision to run cron or not should happen outside of drush (link).
Acquia Cloud's cron wrapper does not check if the site is in maintenance mode before triggering drush cron (link).
Ultimate Cron does not check if the site is in maintenance mode before executing as best as I can tell.
Elysia Cron in D7 had a flag to run cron even if in maintenance mode (link).
Hopefully these notes help someone else!