This document contains information for scheduling automated tasks (cron) from cPanel, so that a script or command runs only at the time or with the frequency you choose.
A cron job is a task that the server automatically executes at certain intervals. It is used, for example, to send newsletters, generate reports, clean temporary files, or execute scheduled tasks for applications like WordPress or Moodle.
Important: tasks must be scheduled with a minimum interval of 15 minutes. Tasks that execute more frequently may be disabled without prior notice.
Some applications, such as Moodle, recommend running their cron every minute. In this service, configure it every 15 minutes: the application works the same, but some automated tasks, such as sending notifications or forum emails, may take a little longer.
If your application needs more frequent tasks or more resources, you can upgrade the service: consult with the sales department from the client portal or via the online chat.
Access: log in to cPanel from the client portal → Log in to cPanel, or at https://yourdomain.com/cpanel. Then open Advanced → Cron Jobs.
Notification Email
In Cron Email, type the address where you want to receive the result of each execution and click Update Email. To stop receiving notices from any task, clear the address.
Adding a Task
- In Common Settings, choose a frequency, for example Once an hour. The Minute, Hour, Day, Month, and Weekday fields are filled in automatically. If you prefer, you can fill them in manually.
- In Command, type the interpreter followed by the full path of the script. For example, for a PHP script:
/usr/local/bin/php /home/username/public_html/script.php
Replaceusernamewith your cPanel username andscript.phpwith the path to your file. The username appears in the cPanel General Information panel. - Click Add New Cron Job.
If you do not want that task to send you an email every time it runs, append >/dev/null 2>&1 to the end of the command:
/usr/local/bin/php /home/username/public_html/script.php >/dev/null 2>&1
Caution: leave enough time between executions so that each one finishes before the next one starts. If they overlap, the site may become slow. And never use the rm command in a task if you are not sure what it does: a mistake can delete your account's files.
Editing or Deleting a Task
Created tasks appear under Current Cron Jobs. To change one, click Edit, modify what you need, and click Edit Line. To remove it, click Delete and confirm.
Common Issues
- The task does not run: check that the script path is full and starts with
/home/username/. Relative paths often fail. - An email arrives with "Permission denied": if you run a script directly, without putting
/usr/local/bin/phpin front of it, the file needs execution permissions (755). - The script works in the browser but not in cron: check that the script uses full paths or that it does not depend on the folder from which it is executed.
- I receive too many emails: add
>/dev/null 2>&1to the end of the command or clear the notification email.
If you need help building the command, open a ticket from the client portal or consult via the site's online chat.
