Cron Wrapper Script Added To Github

May 28, 2013
Karen

I often need to run PHP scripts from a crontab. Sometimes these scripts need to run very frequently, whilst ensuring that only one instance of the script runs at once. It is possible to program these checks within the PHP script. However, I have found that using a shell script is much faster.

This shell script I have added to my Github account allows the same script to be used to wrap multiple PHP files. It can in fact be used with any executable file, not just PHP. A nice touch is that if the script exits with an error, this is passed to the wrapper script to return the error. If the cron user has an email account set up, you will get notified of the error 🙂

https://github.com/karennaylor/cron-wrapper-script

Tags: