无法停止 cron 作业

Unable to stop the cron job

我在 cronjob.txt 中有一个 cron 作业如下

* * * * * nohup sh cronScheduleInit.sh >> cronlog.txt &

和运行它使用命令,

  crontab cronjob.txt

测试后,我使用以下命令删除了 cron 作业条目,

 crontab -e

并且在显示作业列表时使用

crontab -l 

未显示任何条目,但 cron 作业仍然是 运行,我的意思是它正在日志文件中生成条目。甚至我在 cronjob.txt 文件

中评论了工作条目

此外,尝试删除 cron 作业并列出作业。它没有显示 cron 作业,但日志仍然是 运行...

crontab -r

怎么办..请帮忙!!!!

进程可以使用命令ps aux找出。所以检查

ps aux|grep crontab  #or
ps aux|grep cronjob

然后你会得到类似

的东西
user 29587  2.0  1.1 748804 88968 pts/31   Sl+  Mar04  19:55 grunt 

此结果适用于服务 grunt。您必须搜索 crontabcronjob

然后使用进程id终止进程

此处:

sudo kill -9 29587

格式

sudo kill -9 <process_id>