python pid file
Install lockfile:
Choose your path, remember is has to be writable by the user who invokes your python program. Here's an example:
As long as the process is running there will be a file named
https://github.com/openstack/pylockfile
$ pip install lockfile
Choose your path, remember is has to be writable by the user who invokes your python program. Here's an example:
As long as the process is running there will be a file named
/home/me/script.pid
containing the process id; this PID file can be used as a lock file to prevent multiple processes from running at the same time, in case that wasn't already obvious :)https://github.com/openstack/pylockfile