Re: Determine what the calling program is

2021-04-19 Thread Barry
> On 19 Apr 2021, at 22:49, Cameron Simpson wrote: > > On 19Apr2021 23:13, Peter J. Holzer wrote: >>> On 2021-04-19 08:54:06 +1000, Cameron Simpson wrote: >>> My personal preference is lock directories. Shell version goes like >>> this: >>> >>>if mkdir /my/lock/directory/name-of-task >>>

Re: Determine what the calling program is

2021-04-19 Thread Cameron Simpson
On 19Apr2021 23:13, Peter J. Holzer wrote: >On 2021-04-19 08:54:06 +1000, Cameron Simpson wrote: >> My personal preference is lock directories. Shell version goes like >> this: >> >> if mkdir /my/lock/directory/name-of-task >> then >>.. do task .. >>rmdir /my/lock/directory

Re: Determine what the calling program is

2021-04-19 Thread Peter J. Holzer
On 2021-04-19 08:54:06 +1000, Cameron Simpson wrote: > My personal preference is lock directories. Shell version goes like > this: > > if mkdir /my/lock/directory/name-of-task > then >.. do task .. >rmdir /my/lock/directory/name-of-task > else > echo "lock /my/lo

Re: Determine what the calling program is

2021-04-19 Thread Peter J. Holzer
On 2021-04-19 08:04:10 +1200, dn via Python-list wrote: > In a similar situation, one of my teams used an (OpSys) environment > variable (available in both *nux and MS-Win). > - when the application starts, it checks for the variable > - if exists, stops running, else may proceed That doesn't work

Re: Determine what the calling program is

2021-04-19 Thread Barry Scott
> On 18 Apr 2021, at 14:46, Jason Friedman wrote: > > I should state at the start that I have a solution to my problem. I am > writing to see if there is a better solution. > > I have a program that runs via crontab every five minutes. It polls a > Box.com folder for files and, if any are fou

Re: Determine what the calling program is

2021-04-18 Thread Dan Stromberg
It's now at: https://stromberg.dnsalias.org/~strombrg/just-one/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Determine what the calling program is

2021-04-18 Thread Dan Stromberg
I use this little program for shell-level locking. It just checks for a pid file. If the pid file does not exist, or the pid no longer exists, it'll start the process, and write the new process' pid to the pid file. It's at: https://stromberg.dnsalias.org/svn/just-one/ ...and usage looks like:

Re: Determine what the calling program is

2021-04-18 Thread Cameron Simpson
On 18Apr2021 07:46, Jason Friedman wrote: >I should state at the start that I have a solution to my problem. I am >writing to see if there is a better solution. [...] >I have written a piece of code to detect if more than 1 instance of my >program is running, and I put this code into a separate mo

Re: Determine what the calling program is

2021-04-18 Thread dn via Python-list
On 19/04/2021 01.46, Jason Friedman wrote: > I should state at the start that I have a solution to my problem. I am > writing to see if there is a better solution. > > 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

Re: Determine what the calling program is

2021-04-18 Thread Kushal Kumaran
On Sun, Apr 18 2021 at 07:46:53 AM, Jason Friedman wrote: > I should state at the start that I have a solution to my problem. I am > writing to see if there is a better solution. > > I have a program that runs via crontab every five minutes. It polls a > Box.com folder for files and, if any are fo

Re: Determine what the calling program is

2021-04-18 Thread Dieter Maurer
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

Determine what the calling program is

2021-04-18 Thread Jason Friedman
I should state at the start that I have a solution to my problem. I am writing to see if there is a better solution. 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