Guest User

Untitled

a guest
Jan 15th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/bash
  2. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  3.  
  4. KP=$(pgrep -P 1 -f script.php)
  5. if [ "X$KP" = "X" ]
  6. then
  7. /usr/bin/nohup php /var/www/test/script.php >>/var/www/test/log.txt 2>&1 &
  8. fi
  9.  
  10. * * * * * /var/www/test/startup >> /var/www/test/cron.log 2>&1 &
  11.  
  12. * * * * * /var/www/test/startup
  13.  
  14. touch /tmp/mylog
  15. chmod 666 /tmp/mylog
  16.  
  17. echo "I'm getting pgrep from <`type -p pgrep`>" >>/tmp/mylog
  18. echo "KP is now <$KP>" >>/tmp/mylog
  19.  
  20. if [ ! -w /var/www/test/log.txt ]; then echo "Cannot write to /var/www/test/log.txt"; fi
  21.  
  22. (/usr/bin/nohup php /var/www/test/script.php >>/var/www/test/log.txt 2>&1 &)
Add Comment
Please, Sign In to add comment