Get a free website with any plan

See how
HOSTING

Setting up cron jobs

Last updated

IN SHORT

Cron jobs run scheduled commands on your Flashcloud hosting account, like backups, scripts, or email queues, on a set schedule. Create them from Services, your hosting, then the Cron Jobs tile: pick a schedule, enter the command, save. There's no separate start step, once saved, the job is active.

Cron jobs run scheduled commands on your hosting account — a script every hour, a backup every night, an email queue every five minutes. Set them up from the portal in a couple of clicks.

Create a cron job

  1. Go to Services → click your hosting → Cron tile.
  2. Click Create cron job.
  3. Enter:
    • Schedule — pick a preset (every hour, every day, etc.) or enter cron syntax directly.
    • Command — the command to run.
  4. Save.

The job runs at the scheduled times. There's no "start" step — once saved, it's active.

Cron syntax

Cron uses 5 fields: minute, hour, day-of-month, month, day-of-week.

* * * * * command
│ │ │ │ │
│ │ │ │ └─ day of week (0–6, Sunday is 0)
│ │ │ └─── month (1–12)
│ │ └───── day of month (1–31)
│ └─────── hour (0–23)
└───────── minute (0–59)

Common patterns:

  • 0 * * * * — every hour, on the hour.
  • */5 * * * * — every 5 minutes.
  • 0 2 * * * — every day at 2:00 AM.
  • 0 3 * * 0 — every Sunday at 3:00 AM.
  • 0 0 1 * * — first of every month at midnight.
  • 0 9-17 * * 1-5 — every hour from 9 AM to 5 PM, Monday to Friday.

The portal's preset picker handles the common cases. For unusual schedules, write the cron syntax directly.

Common commands

WordPress

WordPress has a built-in scheduler (wp-cron) but it runs on page load, which is unreliable for low-traffic sites. Better to disable that and schedule via real cron:

In wp-config.php:

define('DISABLE_WP_CRON', true);

Then add a cron job:

*/15 * * * * /usr/local/bin/php /home/your-user/public_html/wp-cron.php > /dev/null 2>&1

This runs WordPress's scheduler every 15 minutes — reliable regardless of traffic.

Custom PHP scripts

0 * * * * /usr/local/bin/php /home/your-user/public_html/scripts/hourly-task.php

Shell scripts

Make sure the script has executable permissions (755):

0 2 * * * /home/your-user/scripts/nightly-backup.sh

Curl-based jobs (hitting URLs)

*/5 * * * * curl -s https://yourdomain.com/api/check-queue.php > /dev/null

Useful for triggering web-accessible endpoints.

Suppressing email

By default, cron emails its output to your account email every time a job runs. For frequent jobs, this fills your inbox.

To suppress: redirect output to /dev/null:

*/5 * * * * /usr/local/bin/php /home/your-user/script.php > /dev/null 2>&1

> /dev/null discards stdout. 2>&1 redirects stderr to stdout (which is now /dev/null). The job runs silently.

Limits

Most shared plans cap cron frequency at a minimum of 5 minutes between runs (no * * * * * every-minute jobs). Some specialty plans allow per-minute cron.

For per-minute or sub-minute scheduling, you'll need a VPS or dedicated server.

When cron jobs go wrong

  • Job doesn't run — check the cron syntax. The "schedule" field in the portal validates syntax; the command field doesn't. Common mistake: using shell variables ($HOME) that don't expand in cron's environment.
  • Command not found — use absolute paths to executables (/usr/local/bin/php, not just php).
  • Permission denied — make sure the script is executable: chmod +x /home/your-user/script.sh.
  • Email flood — add > /dev/null 2>&1 to the command.
  • Job hangs — set a timeout: timeout 60 /path/to/command will kill the process after 60 seconds.

Listing and removing

the Cron Jobs tile shows all your active jobs with their schedules and last run time. Click a job to edit; trash icon to remove.

Removed jobs stop running immediately. In-flight executions complete normally.

Common questions

How do I stop cron from emailing me every time it runs?

Redirect the output to /dev/null by adding > /dev/null 2>&1 to the end of your command. This discards the output and sends errors to the same place, so the job runs silently.

Why isn't my cron job running?

Check the cron syntax first, since the schedule field validates it but the command field doesn't. A common cause is using shell variables like $HOME, which don't expand in cron's environment, or a relative path to a command that needs an absolute path instead.

How often can I run a cron job on shared hosting?

Most shared plans cap frequency at a minimum of 5 minutes between runs, so every-minute jobs aren't allowed. Some specialty plans allow per-minute cron, and for per-minute or sub-minute scheduling you'll need a VPS or dedicated server.

How do I set up cron for WordPress?

Disable WordPress's built-in wp-cron by adding define('DISABLE_WP_CRON', true) to wp-config.php, since it only runs on page load and is unreliable on low-traffic sites. Then add a real cron job running */15 * * * * against wp-cron.php so it fires every 15 minutes regardless of traffic.

What do I do if my cron job hangs?

Set a timeout on the command, for example timeout 60 /path/to/command, which kills the process after 60 seconds. This keeps a stuck job from running indefinitely.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.