?
?
#!/bin/bash ############################################## # $Author: neo $ # $Id: chart.xml.sh 1234 2012-08-09 10:15:04Z neo $ ############################################## NAME=info BASEDIR='/www/' PROG=$BASEDIR/bin/$(basename $0) LOGFILE=/var/tmp/$NAME.log PIDFILE=/var/tmp/$NAME.pid ############################################## PHP=/usr/local/php/bin/php ############################################## #echo $$ #echo $BASHPID function start(){ if [ -f "$PIDFILE" ]; then echo $PIDFILE exit 2 fi for (( ; ; )) do cd $BASEDIR/crontab/ $PHP readfile.php > $LOGFILE $PHP chart_xml.php > /dev/null sleep 60 done & echo $! > $PIDFILE } function stop(){ [ -f $PIDFILE ] && kill `cat $PIDFILE` && rm -rf $PIDFILE } case "$1" in start) start ;; stop) stop ;; status) ps ax | grep chart.xml | grep -v grep | grep -v status ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 2 esac exit $??
?
?