diff --git a/content/docs/cronjobs.md b/content/docs/cronjobs.md index da0cb91..70220c3 100644 --- a/content/docs/cronjobs.md +++ b/content/docs/cronjobs.md @@ -19,3 +19,23 @@ runtime: ``` A description of the crontab syntax that is required to define schedules can be found [here](https://www.adminschoice.com/crontab-quick-reference). + +# Example of a Cron Job for Running a PHP Script + +To run a PHP command using a specific version, you need to provide the absolute path to the desired PHP version. Below is a list of the available versions: + +- `/usr/bin/php8.0-cli` +- `/usr/bin/php8.1-cli` +- `/usr/bin/php8.2-cli` +- `/usr/bin/php8.3-cli` +- `/usr/bin/php8.4-cli` + +Below is an example configuration of a cron job that uses the `/usr/bin/php8.3-cli` version to execute a script: + +```yaml +runtime: + cron-jobs: + - command: /usr/bin/php8.3-cli $HOME/htdocs/"path/to/your/script" + schedule: "* * * * *" # runs every minute +``` +With this configuration, the cron job will run every minute using the specified PHP version to execute the script located at $HOME/htdocs/"path/to/your/script".