user3415869
user3415869

Reputation: 91

How can I kill a cron program?

I am using a cron command in Ubuntu that is running a python program:

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

How do I stop the program from running?

Upvotes: 0

Views: 1505

Answers (1)

Bibhas Debnath
Bibhas Debnath

Reputation: 14939

Open terminal, run

$ ps aux | grep hello.py

It'll show an output like this -

username   NNNN  0.0  0.0  13648   940 pts/7    S+   01:04   0:00 /usr/bin/python /home/ahmed/Desktop/hello.py

Where NNNN is the process ID. Then just execute -

$ sudo kill -9 NNNN

That should kill the process. Then remove it from cron if you don't want to do this again.

Upvotes: 1

Related Questions