Cron jobs allow you to schedule scripts or commands to run automatically on your hosting account β for example, to trigger backups, send scheduled emails, or refresh data.
If your website or application relies on regular background tasks, setting up a cron job ensures these tasks run reliably without manual intervention.
π First: Access Your Hosting Control Panel
If youβre not already logged in, follow this guide:
π How to Access Your Web Hosting Control Panel
Once logged in, look for the Cron Jobs section.
β Creating a Cron Job
-
In the control panel, click on Cron Jobs
-
Under Add New Cron Job, configure the following:
β² Schedule
You can manually enter values or use the dropdown presets. Each field defines when your script runs:
-
Minute (0β59)
-
Hour (0β23)
-
Day (1β31)
-
Month (1β12)
-
Weekday (0β6, where 0 = Sunday)
For example, to run a task every day at 3am:
Minute:
0
Hour:
3
Day:
*
Month:
*
Weekday:
*
Or use the preset dropdown for quick options like:
-
Once per day
-
Once per hour
-
Once per week
π» Command to Run
This is the actual command or script you want to run. Common examples:
PHP Script:
/usr/local/bin/php /home/yourusername/domains/yourdomain.com/public_html/cron.php
Wget (URL-based script):
/usr/bin/wget -q -O /dev/null https://yourdomain.com/cron.php
Curl (alternative to wget):
/usr/bin/curl -s https://yourdomain.com/cron.php > /dev/null
Make sure your script is:
-
Executable
-
Correctly located in your file structure
-
Capable of running in a non-browser environment (i.e., command line)
π§ͺ Testing a Cron Job
-
You can run the script manually via File Manager or a browser to confirm it works
-
After saving the job, wait for the scheduled time to see if it executes
-
For debugging, consider adding output to a log file:
/usr/local/bin/php /home/yourusername/domains/yourdomain.com/public_html/cron.php >> /home/yourusername/cronlog.txt 2>&1
π Managing Existing Cron Jobs
-
All saved cron jobs appear in a list below the form
-
You can Edit or Delete any cron job at any time
-
Review them periodically to remove unused or outdated jobs
π‘ Security Tip
If you're triggering cron jobs using a public URL (e.g. cron.php
), consider:
-
Adding a secret token in the URL
-
Blocking public access to the script via
.htaccess
or IP restriction