ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[root@localhost sh]# cat order.sh #!/bin/bash cd /var/www filename=`date +%Y_%m_%d` timer(){ TIMEOUT=$1 CMD=$2 eval $CMD PID=$! STIME=0 while [ $STIME -le $TIMEOUT ] do ps -A -opid | grep $PID if [ $? -eq 0 ];then if [ $STIME -eq $TIMEOUT ];then kill -9 $PID break else sleep 1 STIME=$[STIME+1] echo $STIME; fi else break fi done } timer 600 "php /var/www/html/sh/order.php >> /var/www/html/data/order_${filename}.log &"