How to Use Cron Jobs for Automated Tasks
Cron jobs allow you to schedule commands or scripts to run automatically at set intervals. On your dotCanada hosting account, you can manage cron jobs directly from cPanel - no command-line configuration needed.
Setting Up a Cron Job in cPanel
- Log in to cPanel and go to Advanced > Cron Jobs.
- Choose a common schedule from the Common Settings dropdown (e.g., Once Per Day), or enter a custom schedule using cron syntax.
- In the Command field, enter the command you want to run.
- Click Add New Cron Job.
Understanding Cron Syntax
Cron jobs use a five-field time format: minute hour day month weekday. For example:
0 * * * *- Every hour on the hour30 2 * * *- Every day at 2:30 AM*/15 * * * *- Every 15 minutes
Common Use Cases
- WordPress cron:
php /home/username/public_html/wp-cron.php - Laravel scheduler:
php /home/username/myapp/artisan schedule:run - Database backups:
mysqldump -u dbuser -pdbpass dbname > /home/username/backup.sql - Python script:
/home/username/virtualenv/myapp/bin/python /home/username/myapp/script.py
Checking Output
By default, cron job output is emailed to you. To suppress it, append > /dev/null 2>&1 to your command.
If a cron job isn't running as expected, contact our support team and we'll help you debug it.
100% Satisfaction Guarantee
We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.
Ready to Get Started?
Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.
Get Started Today
