This question already has an answer here:
I want to automate running a Python script. And I think I already know how to do that with a cron entry.
The problem is that I need this script to run again only if a previous one has finished.
The Python script reads from a
.csv file (only the first record), and gives it as parameters for the script onward. Then this record is removed from that table (which is essentially like a list of runs that need to be done) and is moved to another table for finished tasks along with the result of the script.
So, because records are being deleted at every run, I need a following iteration of the script to start only if the previous one finished.
How/Can I do that under Ubuntu 16.04 LTS?
I tried scheduling the python script this way and installed run-one like that:
sudo apt-get update sudo apt-get install run-one # The below code is in crontab * * * * * run-one python '/home/phdmonster/Downloads/nn course/my_code.py'
Aand, it doesn't work. No tasks are run.
Edit by Sergiy Kolodyazhnyy: Issue resolved in comments, also discussed in linked chat room; issue was with extra
*, linked duplicate works as per OP's comments