I'm having trouble running a single instance of a PHP script using CRON. Perhaps someone can help explain what is needed. Currenty, I have a startup
script that is called by crontab
which checks to make sure an instance of a PHP script isn't already running before calling the PHP instance.
crontab -e
entry:
* * * * * /var/www/private/script.php >> /var/www/private/script.log 2>&1 &
./startup
#!/bin/bash
if ps -ef | grep '[s]cript';
then
exit;
else
/usr/bin/php /var/www/private/script.php >>/var/www/private/script.log 2>&1 &
echo 'started'
fi
This doesn't seem to be working and I can't seem to get any errors logged to know how to proceed to debug this.