Created
September 13, 2011 07:03
-
-
Save papettoTV/1213293 to your computer and use it in GitHub Desktop.
バッチ処理が重複するのを避ける方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec_file='/full/path/to/exec_file_name.php' | |
pid=`pgrep -f $exec_file` | |
#if not running | |
if [ -z $pid ] ; then | |
echo "Done!!" | |
php $exec_file | |
#don't exec | |
else | |
echo "canceled" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment