Knowledgebase

Cron Scripts and Scheduled Tasks Print

  • otherapplicationsscripts, other, cron, wordpress, php, redirects, cpanel, email, backup, firewall
  • 0

Running things automatically.

CREATING ONE

cPanel > Cron Jobs. Set the interval and the command, using the full path to PHP and to your script.

Leave the notification email blank unless testing, or you receive mail on every run.

GOOD PRACTICE

Test the command manually before scheduling it Redirect output to a log rather than discarding it, at least initially Use full paths, since cron runs with a minimal environment Avoid every-minute schedules unless genuinely needed

THE WORDPRESS POINT

HTTP requests to wp-cron.php are blocked on our servers. WordPress needs DISABLE_WP_CRON set and a real cron job, or scheduled posts, updates, backups and plugin tasks silently stop.

FOR FRAMEWORKS

Laravel expects one cron entry running its scheduler, which dispatches the tasks you defined. Check your framework's documented arrangement.

VERIFYING

Check the log you redirected to, and check the effect. A job that has silently failed for months is common.

CLEANING UP

Delete cron jobs for software you have removed. Orphaned jobs keep running and generating errors.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot