Determine what the calling program is

Dieter Maurer dieter at handshake.de
Sun Apr 18 12:28:10 EDT 2021


Jason Friedman wrote at 2021-4-18 07:46 -0600:
> ...
>I have a program that runs via crontab every five minutes. It polls a
>Box.com folder for files and, if any are found, it copies them locally and
>performs a computation on them that can exceed five minutes. It pushes the
>results back up to Box. (Box.com ensures that only complete files are
>visible when I poll.) Files are dropped into this Box.com folder rarely,
>but to ensure a good customer experience I do not want to set my crontab to
>run less frequently. My hardware cannot support multiple simultaneous
>computations.

Programs typically use some form of file locking to detect
attempts to run the same program multiple times.

The optimal form of locking depends on the operating system.
Under *nix, so called advisory locks seem promising.


More information about the Python-list mailing list