Skip to content

Instantly share code, notes, and snippets.

@papettoTV
Created September 13, 2011 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save papettoTV/1213293 to your computer and use it in GitHub Desktop.
Save papettoTV/1213293 to your computer and use it in GitHub Desktop.
バッチ処理が重複するのを避ける方法
#!/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