Skip to main content
Blog|
Knowledge base

How to Set Up and Manage Cron Jobs

|
Feb 28, 2026|6 min read
KNOWLEDGE BASEHow to Set Up and Manage CronJobsHOSTNEYhostney.comAugust 21, 2023

Cron jobs run tasks on a schedule. In Hostney, they work by calling a URL on your website at the interval you define. Every time the cron fires, the server makes an HTTPS request to your specified URL, exactly like a visitor loading that page. Whatever that URL triggers (a script, a WordPress function, a cleanup routine) runs automatically.

Common uses:

  • Running WordPress cron ( wp-cron.php ) on a reliable schedule instead of relying on visitor traffic
  • Sending scheduled emails or digests
  • Clearing expired cache or temporary files
  • Generating reports or processing queued tasks
  • Syncing data with external services

Creating a cron job#

Step 1: Open the cron jobs page

Sign in at my.hostney.com and navigate to Cron jobs in the sidebar.

The page has two tabs:

  • Manage — create new cron jobs and view existing ones
  • Results — see execution history from the last 24 hours

Step 2: Fill in the form

In the “Add cron job” section at the top, fill in three things:

Website: Select the website from the dropdown. The cron job will call a URL on this website.

URL to call: Enter the path to the script or endpoint you want to trigger. For example, entering wp-cron.php will call https://yourwebsite.com/wp-cron.php . The full URL is shown in the preview. Query strings and fragments are not allowed in the URL field.

Schedule: Set the timing using five dropdown fields:

FieldWhat it controlsCommon presets
MinuteWhich minute(s) of the hourEvery minute ( * ), every 5 min ( */5 ), every 15 min ( */15 ), every 30 min ( */30 ), or a specific minute (0–59)
HourWhich hour(s) of the dayEvery hour ( * ), every 2 hours ( */2 ), every 6 hours ( */6 ), every 12 hours ( */12 ), or a specific hour (0–23, shown in 12-hour format with AM/PM labels)
Day of monthWhich day(s) of the monthEvery day ( * ), every other day ( */2 ), 1st and 15th ( 1,15 ), or a specific day (1–31)
MonthWhich month(s) of the yearEvery month ( * ), every 2 months ( */2 ), quarterly ( */4 ), every 6 months ( 1,7 ), or a specific month (1–12)
Day of weekWhich day(s) of the weekEvery day ( * ), weekdays only ( 1-5 ), weekends only ( 0,6 ), Mon/Wed/Fri ( 1,3,5 ), Tue/Thu ( 2,4 ), or a specific day (0=Sunday through 6=Saturday)

Step 3: Preview and save

Click Show preview to see the complete cron expression and the full URL that will be called. This helps you verify the schedule is correct before saving.

Click Create cron job to save. The cron job appears in the table below and starts running on the schedule you defined.

If you need to start over with the timing fields, click Reset timing to clear all five schedule dropdowns.

Schedule examples

Here are some common schedules and how to set them:

ScheduleMinuteHourDayMonthWeekday
Every 15 minutes */15 * * * *
Once per hour (on the hour) 0 * * * *
Daily at midnight 0 0 * * *
Daily at 3:00 AM 0 3 * * *
Twice daily (noon and midnight) 0 */12 * * *
Weekdays at 9:00 AM 0 9 * * 1-5
First day of every month at 6:00 AM 0 6 1 * *
Every Monday and Thursday at 2:00 AM 0 2 * * 1,4

Managing existing cron jobs#

All your cron jobs appear in a searchable, sortable table showing:

  • Website — which website the cron job belongs to
  • URL — the path being called
  • Schedule — displayed as visual badges for each timing field (minute, hour, day, month, weekday)

Testing a cron job

You can run any cron job manually without waiting for the schedule:

  1. Click the dropdown menu on the cron job row
  2. Select Test
  3. In the modal that appears, click Run test
  4. The modal polls for results and displays them in real time:
    • Status — Queued, Running, Completed, Failed, or Timeout
    • HTTP status code — the response code from your URL (200, 404, 500, etc.)
    • Duration — how long the execution took
    • Output preview — the first 500 characters of the response

Click View full output to switch to the Results tab and see the complete response.

Deleting a cron job

  1. Click the dropdown menu on the cron job row
  2. Select Delete
  3. Read the warning: “Removing this cron job will stop all scheduled executions”
  4. Type  DELETE  in the confirmation field
  5. Click Delete to confirm

The cron job is removed immediately and no further executions will occur.

Viewing execution results#

Switch to the Results tab to see a history of all cron job executions from the last 24 hours. The table auto-refreshes every 30 seconds and shows:

ColumnDescription
WebsiteWhich website the cron ran on
URLThe endpoint that was called
TypeScheduled (automatic) or Manual (from the test button)
StatusQueued, Running, Completed, Failed, or Timeout
HTTPResponse status code, color-coded (green for 2xx, blue for 3xx, orange for 4xx, red for 5xx)
DurationExecution time in milliseconds or seconds
TimeWhen the execution ran (shown as relative time like “5m ago” with full timestamp on hover)

Click the dropdown menu on any result row and select View output to see the full response. The output modal shows:

  • Output tab — the response body (stdout) from your URL
  • Errors tab — any error output (stderr)
  • Copy and download buttons for saving the output
  • A truncation notice if the output exceeded 64KB

Results are retained for 24 hours, then automatically cleaned up.

WordPress cron (wp-cron.php)#

WordPress has a built-in task scheduler that normally runs when someone visits your site. On low-traffic sites, this means scheduled tasks (like publishing scheduled posts, sending email digests, or running plugin maintenance) may run late or not at all because no visitor triggered them.

The fix is to disable WordPress’s visitor-triggered cron and replace it with a real cron job:

Step 1: Disable WordPress cron

Add this line to your wp-config.php file (before /* That's all, stop editing! */ ):

define('DISABLE_WP_CRON', true);

This prevents WordPress from checking for scheduled tasks on every page load, which also slightly improves page load times.

Step 2: Create the cron job in Hostney

  • Website: Select your WordPress site
  • URL to call:  wp-cron.php
  • Schedule: Every 15 minutes is a good default ( */15  for minute,  *  for everything else)

This ensures WordPress tasks run reliably every 15 minutes regardless of site traffic.

Tips#

Start with a test. After creating a cron job, use the Test button to run it manually and verify it works. Check the HTTP status code (should be 200) and review the output for any errors.

Watch the results tab. After your cron has been running for a day, check the Results tab to make sure executions are completing successfully. Repeated failures or timeouts indicate a problem with the script being called.

Don’t schedule too aggressively. Running a heavy script every minute puts unnecessary load on your server. Most tasks work fine at 15-minute or hourly intervals. Only use per-minute scheduling when the task genuinely requires it.

Duplicate prevention. Hostney won’t let you create two cron jobs with the exact same schedule and URL. If you need the same URL called at different times, create separate cron jobs with different schedules.

If you need help with cron jobs, contact our support team.

Related articles