Skip to content
Servers and Linux2 min read

What is a cron job?

Short answer

A cron job is a command or script the server runs automatically on a schedule you define, such as every 5 minutes or every day at 3 a.m. It's used to run site tasks, send scheduled emails, clean temporary files and make backups.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Cron syntax
  2. Ready-made schedules
  3. Why a cron job doesn’t run
  4. On ArabyHost

Cron is a Linux service that reads a table called the crontab every minute and runs any line whose time has come. Each user has their own crontab, and each line is five time fields followed by the command to run. Cron doesn’t need anyone to visit your site; it runs on the server itself.

Cron syntax

*  *  *  *  *  command
Field, in order Allowed values
Minute 0-59
Hour 0-23
Day of month 1-31
Month 1-12
Day of week 0-7 (Sunday is 0 or 7)

* means “every value”, */5 means “every 5th”, and a comma lists values, as in 1,15.

Ready-made schedules

Schedule Meaning
*/5 * * * * Every 5 minutes
0 3 * * * Daily at 3:00 a.m.
0 0 * * 1 Every Monday at midnight
0 */6 * * * Every 6 hours

A practical example, running Laravel’s scheduler every minute:

* * * * * cd /home/user/app && php artisan schedule:run >> /dev/null 2>&1

In WordPress you can disable the visit-triggered WP-Cron and call wp-cron.php from a real cron job, which fixes scheduled tasks not running in WordPress. To build a schedule without mistakes, use the cron generator.

Why a cron job doesn’t run

  • Relative paths: cron doesn’t start in your project folder. Use full paths or cd first.
  • A different PHP: php in cron may be a different version from the one your site uses; give the full path if needed.
  • A minimal environment: cron runs with few environment variables and a short PATH, so don’t expect your shell settings.
  • Hidden errors: sending output to /dev/null hides everything. Log to a file while testing.

More in cron job not running.

On ArabyHost

You add scheduled tasks in cPanel → Cron Jobs; cPanel opens with one click from the Araby Panel, and the full steps are in the cron jobs setup guide. On the Developer and AI plans, cron is also how background workers stay alive, such as a Telegram bot or a queue worker: a line that runs every few minutes, checks the process and restarts it if it has stopped.

FAQ

What's the shortest interval a cron job can run at?

One minute, with `* * * * *`. If you need something to run more often than that, a long-running background process is a better fit than cron.

Does cron use my local time zone?

No, it follows the time zone configured on the server, which may differ from yours. Work out the offset before picking an hour, especially for daily jobs.

How do I know a cron job actually ran?

Send its output to a log file, e.g. `>> /home/user/cron.log 2>&1`, and check it after the scheduled time. If the file stays empty, the job didn't start or the command prints nothing.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.