I have a script that runs every hour, and without using a database, I would like to check if that file is either: (1) currently running; (2) already completed; or (3) not yet run. If it's #3, then I run it, otherwise I skip it. What would be a good way to track this outside of a database? For example, I was thinking:
MyApplicationFolder/
script.py
proc/
running/
$pid_$integrity_field
completed/
$integrity_field
In this way, when I run the script I could:
- check to see if it's currently running (if integrity_field in
running/*
). And if it's already running I can grab the processID (in case I need to send a signal to it). - check to see if it's already completed (if integrity_field in
completed/*
).
Is this something like a standard approach to doing this, or what might be a better or more standardized way to do this approach (again, not using a DB to track it)?