I am 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 crontab , which checks that the PHP instance script is not already running before the PHP instance is called.
crontab -e entry:
* * * * * /var/www/private/script.php >> /var/www/private/script.log 2>&1 &
./start
#!/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 does not seem to work, and I cannot get any errors to log in to find out how to debug them.
source share