I have Ubuntu 10.04 server with Lightspeed (web server), PHP5, Mysql, TCPDF and sendmail i need to run the cron job for queue in case if any job is running already then it has to create queue, if not the then it will goto tcpdf folder sendmail.
for i got one code from serverfault
`PIDFILE=/tmp/`basename $0`.pid
if [ -f $PIDFILE ]; then
if ps -p `cat $PIDFILE` > /dev/null 2>&1; then
echo "$0 already running!"
exit
fi
fi
echo $$ > $PIDFILE
trap 'rm -f "$PIDFILE" >/dev/null 2>&1' EXIT HUP KILL INT QUIT TERM`
but i m not getting how to run the show can same help me on the same sorry for my English.
Best Answer
You could make it all in php, for example my_cron.php content:
Then at your cronjob have something like this: