Re: [Tutor] Lock File Usage

2017-02-01 Thread Ben Finney
"ad^2" writes: > Thanks for the help guys. This is what I ended up going with that works. > > Requires: lockfile, syslog and os modules You're probably aware, but for others reading this thread: The ‘lockfile’ library is explicitly deprecated by its maintainers https://pypi.python.org/pypi/lock

Re: [Tutor] Lock File Usage

2017-02-01 Thread ad^2
On Mon, Jan 30, 2017 at 7:33 PM, Ben Finney wrote: > "ad^2" writes: > > > So, IF: no lock file, create a lock file, execute, delete lock file > > when finished successfully. ElSE: the script is running, exit. Then, > > cron will try again an hour later. > > > > I do not necessarily require a "l

Re: [Tutor] Lock File Usage

2017-01-30 Thread Ben Finney
"ad^2" writes: > So, IF: no lock file, create a lock file, execute, delete lock file > when finished successfully. ElSE: the script is running, exit. Then, > cron will try again an hour later. > > I do not necessarily require a "lock file" just looking for a > recommendation on a best practice w

Re: [Tutor] Lock File Usage

2017-01-30 Thread Alan Gauld via Tutor
On 30/01/17 14:45, ad^2 wrote: > So, IF: no lock file, create a lock file, execute, delete lock file when > finished successfully. ElSE: the script is running, exit. Then, cron will > try again an hour later. That's probably the most common way of doing what you want. But you need to make absolu

[Tutor] Lock File Usage

2017-01-30 Thread ad^2
Hello all, I have more more todo on a script I just finished. Prevent it from executing again if the process is running from the last job. Can't go to production without it. Ex. it runs in cron every hour to process batches of large size files. Potentially the processing could take longer than on