Introduction
This article will walk you through creating a cron job that runs a file.
Procedure
First, log into cPanel and click on "Cron Jobs" under the "Advanced" section. Under "Add new cron job", either select one of the common timing options provided using the "Common Settings" drop-down box or manually input the desired frequency you would like the cron job to run. Then in the "Command" box, we can input the command along with the path to the file we want to run, examples:
Running a PHP file with the default version of PHP on the server:
php /path/to/file.php
Running a PHP file with a specific version of PHP:
ea-php73 /path/to/file.php
Running a bash file:
sh /path/to/file.sh
Finally, click the blue "Add new cron job" button to finalize the addition.
Comments
0 comments
Article is closed for comments.