CDNShark Documentation

Web Hosting

← Back to Documentation

Schedule Cron Jobs

Cron runs a command on a schedule, for example a nightly cleanup script or WordPress's scheduled tasks.

Steps

  1. Open your hosting account → Cron → Add Cron Job.
  2. Schedule: five fields (minute hour day month weekday) or a shortcut such as @daily.
  3. Command: what to run (up to 500 characters).
  4. Click Add Cron Job. The job shows pending, then active.

Schedule examples

ScheduleRuns
*/15 * * * *Every 15 minutes
0 * * * * or @hourlyEvery hour, on the hour
0 3 * * *Every day at 03:00
30 2 * * 1Mondays at 02:30
@daily / @weekly / @monthlyOnce a day / week / month

Times are in the server's time zone (UTC).

Command examples

# Run a PHP script with PHP 8.3
/usr/bin/php8.3 ~/domains/example.com/public_html/cron.php

# WordPress scheduled tasks (with DISABLE_WP_CRON set in wp-config.php)
/usr/bin/php8.3 ~/domains/example.com/public_html/wp-cron.php

# Laravel scheduler, every minute (schedule: * * * * *)
/usr/bin/php8.3 ~/domains/example.com/artisan schedule:run
  • Use the PHP binary for your version: php8.2, php8.3 or php8.4.
  • Jobs run as your hosting user, with your files and limits.
  • To keep a log, add >> ~/logs/cron.log 2>&1 to the command.

Removing a job

Click the trash icon on its row. Jobs stop while an account is suspended and come back when it's reactivated.