Skip to content

Instantly share code, notes, and snippets.

@jasonbradley
Created July 7, 2012 21:47
Show Gist options
  • Save jasonbradley/3068177 to your computer and use it in GitHub Desktop.
Save jasonbradley/3068177 to your computer and use it in GitHub Desktop.
Check for PHP script already running
#!/bin/sh
if ps -ef | grep -v grep | grep my_script.php ; then
exit 0
else
php /var/www/my_script.php
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment