python - 我怎样才能杀死一个 cron 程序?

标签 python ubuntu cron

我在运行 python 程序的 Ubuntu 中使用 cron 命令:

05 23 * * * python /home/ahmed/Desktop/hello.py

如何停止程序运行?

最佳答案

打开终端,运行

$ ps aux | grep hello.py

它会显示这样的输出 -
username   NNNN  0.0  0.0  13648   940 pts/7    S+   01:04   0:00 /usr/bin/python /home/ahmed/Desktop/hello.py

其中 NNNN 是进程 ID。然后执行 -
$ sudo kill -9 NNNN

那应该杀死这个过程。如果您不想再次执行此操作,请将其从 cron 中删除。

关于python - 我怎样才能杀死一个 cron 程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22388915/

相关文章:

python - Python 中经过评估/动态生成的函数的源代码

ubuntu - gcloud 命令在 crontab -e 中不起作用?

python - 使用 cron 运行 python 脚本,matplotlib 错误

python - 在本地计算机上利用拼写检查器?

python - 将整数与MagicMock进行比较在python的unittest中不起作用

ubuntu - 身份验证 localhost 失败,尽管有 ssh-keys

php - 启用 ssl 后 Cron 作业停止工作

bash - 如何模拟cron执行脚本的环境?

Windows 上的 python select.select()

linux - Expect 交互效果很好,但不是来自文件