How do I create a cron job?
Category: Advanced
To create a cron job in cPanel is quite easy, yet it provides excellent functionality by allowing the execution of scripts at set times.
- Login to cPanel.
- Go to the “Cron Jobs” option.
- Specify the frequency of the cron and enter the command needing to be run.
- Save.
If you need to load a custom php.ini to utilise custom environmental values, you may do so by running the command as such:
php -i /home/cpanelusername/public_html /home/cpanelusername/public_html/path/to/file.php
Where the initial /home/cpanelusername/public_html is the directory where your php.ini resides.