I have a python file which I would love to run on task every hour, but when I start the task, it runs with same multiple running task consuming much CPU speed. I would love to kill the previous running task before starting new task so that I will have only I unique task running.
I did this
import signal import os pid=os.getpid() os.kill(pid, signal.SIGTERM)
my program codes follows below
This terminates the task but doesn't run the codes below to start a new task
How can I achieve this. Thanks in anticipation