Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- KP=$(pgrep -P 1 -f script.php)
- if [ "X$KP" = "X" ]
- then
- /usr/bin/nohup php /var/www/test/script.php >>/var/www/test/log.txt 2>&1 &
- fi
- * * * * * /var/www/test/startup >> /var/www/test/cron.log 2>&1 &
- * * * * * /var/www/test/startup
- touch /tmp/mylog
- chmod 666 /tmp/mylog
- echo "I'm getting pgrep from <`type -p pgrep`>" >>/tmp/mylog
- echo "KP is now <$KP>" >>/tmp/mylog
- if [ ! -w /var/www/test/log.txt ]; then echo "Cannot write to /var/www/test/log.txt"; fi
- (/usr/bin/nohup php /var/www/test/script.php >>/var/www/test/log.txt 2>&1 &)
Add Comment
Please, Sign In to add comment