Linux 查杀进程

ps -eaf |grep "stoporder.php" | grep -v "grep"| awk '{print $2}'|xargs kill -9

  

#!/bin/bash
count=`ps -fe |grep "baocang.php" | grep -v "grep" | wc -l`
if [ $count -lt 1 ]; then
	nohup /phpstudy/server/php/bin/php /mnt/hgfs/Web/xiang/baocang.php &
fi

count=`ps -fe |grep "stoporder.php" | grep -v "grep" | wc -l`
if [ $count -lt 1 ]; then
	nohup /phpstudy/server/php/bin/php /mnt/hgfs/Web/xiang/stoporder.php &
fi

  

linux 下怎么查看crontab是否自动启动

使用 chkconfig | grep crond 看在2 3 4 5级别是不是on
crontab默认就是开机启动的,普通用户要有sudo的权限才能设置开机启动

查看 crontab 是否执行

cat /var/log/cron

每分钟执行

*/1 * * * * root  /root/checkout.sh

  

  

  

原文地址:https://www.cnblogs.com/hefei/p/5629317.html