I was thinking about this solution, but what can I do if the script ends prematurely. The file will never be deleted ?? Anybody has an example of how to use flock ?
Nicolas "Gerard Onorato" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > There may be a much easier method however why not write a file and then check for it's existence on the next execution. Delete the file at the end of > execution to clear the way for the next pass. > > Quick and dirty so probably at least on typo > <? > $pidFile = "path/to/file/filename"; > if (!is_file ($pidFile)) { > touch ($pidFile); > // code to execute > unlink ($pidFile); > } > ?> > On Fri, 28 Dec 2001 15:31:33 +0100, Nicolas Guilhot wrote: > > >Running a php script with a cron job, how can I do to have only one instance > >of the script running ? > > > >Thanks for any answer. > > > > > >Nicolas > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]