Reputation: 20409
I have the following task:
- description: Task is run every 2 hours
url: /task
schedule: every 2 hours synchronized
Is there any way to know in my python code when it was run last time (date and time)? The idea I have now is to store that in memcache when it is finished to run. But is there any other better way?
PS. Another problem I have is with the case when memcache is empty. How can I calculate when last run was?
Upvotes: 1
Views: 2392
Reputation: 1122182
You can't, not without storing the information of the last run somewhere. Cron, by itself, does not track that for you.
Upvotes: 3
Reputation: 943
Why not add an extra bit of code to the file that is ran that creates a log, like a text file?
Upvotes: 2