I’ve come across a checklist for creating a new PHP cron at my job and one of the directions is:
Add a wrapper file that calls the main part of your job code as
cron_[name].sh
A sample cron.sh:
#!/bin/sh
###########################################################
# This job sends out the daily digest emails
###########################################################
. $DS_JOBS_DIR/cron_common.sh
cd $DS_JOBS_DIR/digests
$DS_PHP daily_digest.php
What is the benefit of wrapping a PHP cron inside a shell script?
No reason.
But you could perform multiple things in the shell script after that – more php or other tasks.
But my main guess is that if you found it in the ‘checklist for creating a new PHP cron’, then it’s is simply how the organisation want things done – due to factors above, or simply how their IT Manager/server administrators are preferring it be done.