cron_queue.sh
548 Bytes
#!/bin/bash
phpscriptDir=/Data/code/yohomarket/yohomarket.im/
phpcmd=/Data/local/php-5.4.23/bin/php
fragmentNum=$(ps -ef |grep -e $phpscriptDir"/Server/php/Dispatch.php"|grep -v grep|wc -l)
log()
{
var=$1
now=`date +%Y-%m-%d`
logPath=/Data/logs/
fileName=$now"_phpscript_cron.log"
cd $logPath
echo "phpscript name: "$var" restart time `date "+%Y-%m-%d %H:%M:%S"` " >>$fileName
}
if [ $fragmentNum -le 0 ]
then
nohup $phpcmd $phpscriptDir"/Server/php/Dispatch.php" >/Data/logs/Dispatch.log &
log "Dispatch.php"
fi
exit 0