Knowledgebase

What Cron Jobs Can and Cannot Do Print

  • cronjobsscheduledtasks, cron, php, resourcelimits, suspension, guide, howto, solution
  • 0

The boundaries.

WHAT THEY CAN DO

Run a PHP script Run a shell command Trigger a URL, where that is appropriate Run application command-line tools

WHAT THEY CANNOT DO

Run more frequently than once a minute Run something requiring interaction Guarantee exact timing under load Run if the account is suspended

TRIGGERING A URL VERSUS RUNNING A SCRIPT

Running the PHP script directly is generally better: faster, no web server involvement, no HTTP timeout.

Triggering a URL is sometimes required by an application.

THE HTTP TIMEOUT POINT

A job triggering a URL is subject to web server timeouts.

A long job run that way may be cut off partway.

RESOURCE LIMITS

Cron jobs consume your account's resources like anything else.

A heavy job at a busy time affects your site.

WHAT TO CHECK

Whether the application provides a command-line method.

Most do, and it is the better option.


Was this answer helpful?
Back

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


Trustpilot