AmanaFlow.
Tutorials

Setting Up a Cron Job in cPanel: Simplified

Setting Up a Cron Job in cPanel: Simplified

Verified Knowledge

AF
AmanaFlow Engineering
L3 Systems Team
2 min read
TL;DR

Quick Summary: A "Cron Job" is a scheduled task. You provide a "Command" (the path to your script) and a "Schedule" (how often it should run). Common for backups, email queues, and database maintenance.

What is a Cron Job?

Think of it as an alarm clock for your server. If you have a script that needs to send a newsletter every Monday at 9:00 AM, a Cron Job is the tool that makes it happen without you being awake.

The 5 Stars of Scheduling

Cron uses five stars to define time: * * * * *

  1. Minute (0-59)
  2. Hour (0-23)
  3. Day of Month (1-31)
  4. Month (1-12)
  5. Day of Week (0-6)

Setting it up in cPanel

1. Find the Cron Jobs Icon

Log in to cPanel and search for "Cron Jobs" in the Advanced section.

2. Choose a "Common Setting"

cPanel provides defaults like "Once per hour" or "Once per day." For most purposes, these are the safest bet.

3. Enter the Command

This is where people usually fail. You need the Full Path to the PHP executable and the Full Path to your script. Example: /usr/local/bin/php /home/username/public_html/cron.php


Avoiding "Cron Bloat"

Don't set scripts to run every minute unless absolutely necessary. Too many simultaneous cron jobs can spike your CPU and slow down your website for visitors. For high-volume tasks, consider a Managed VPS where you have more control over the background process priority.

Scale with AmanaFlow Cloud


FAQ

Q: Can I get an email when the cron job runs?
A: Yes. You can set a "Cron Email" in the manager. However, if the job runs every minute, your inbox will fill up fast!

Q: My cron job isn't working, why?
A: Check the permissions of the script file. It should be set to 0644. Also, ensure the file paths are 100% correct.

Share this post
Last updated March 2026