Introduction
This article will walk you through creating a Cron job that executes a file or script.
Procedure
- Log in to cPanel as the user you want to edit Cron jobs under.
- Navigate to the menu: "Advanced / Cron Jobs"
- Click "Add new Cron job"
- Specify the time intervals, or select from "Common Settings"
- Input the binary and script to run with it (examples below)
- Finally, click the blue "Add new Cron job" button to finalize the addition.
Examples of specifying the binary and script to execute:
- Executing a PHP file with the default version of PHP on the server:
php /path/to/file.php
- Executing a PHP file with a specific version of PHP:
ea-php73 /path/to/file.php
- Executing a bash file:
sh /path/to/file.sh
Please note that each example must be customized to run the binary and script you intend to run. These examples will not function as-is.
Comments
0 comments
Article is closed for comments.