Frequently asked questions for scheduling and running cron jobs on your Ecenica plan.
This article explains what cron jobs are, how you can add a cron job to your Ecenica plan, how to delete and stop a scheduled cron job from running and what the limits are for running cron jobs.
What are Cron Jobs?
Cron jobs allow you to schedule commands or execute scripts to run at specific times or intervals.
How can I create a cron job?
You can create a cron job from your Ecenica cPanel control panel following the steps below:
- Log in to cPanel.
- For help accessing your cPanel see Where do I log in to my hosting control panel.
- Click Cron Jobs
- Enter your email address. Notifications for your cron job will be sent to this email address which is useful for debugging.
- Enter the command to run. For example:
- to run a PHP script use:
/usr/bin/php /home/yourusername/public_html/script.php
or
curl "https://example.com/script.php
- to run a PHP script use:
- Select how often you wish your cron job to be run. Select options for minutes, hours, days, months and weekdays. Or, select one of the pre-defined schedules from common settings.
- Click Add New Cron Job.
How can I remove a cron job?
If you no longer need your cron job you can delete it and stop your cron job from running using the steps below:
- Log in to cPanel.
- For help accessing your cPanel see Where do I log in to my hosting control panel.
- Click Cron Jobs
- Click Delete next to your cron job.
What limits are there for cron jobs?
On Shared or Reseller Hosting plans you may not run a cron job more often than every 15 minutes.
My cron job creates hundreds of empty php files
If you’re using wget to call a php script in your cron command then by default, wget will generate an output file. To stop the file being generated you can change your cron job to output wget to /dev/null as the destination using the -O or –output-file option. /dev/null is a special location which effectively deletes the output.
For example:
wget -O /dev/null https://www.example.com/cronscript.php