note 12508 deleted from function.flock by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 19:09:16 +0000 |
| Subject: | note 12508 deleted from function.flock by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22081@lists.php.net to get a copy of this message | ||
I use flock() to prevent more than one instance of a cron job running (it could mess some stuff in a
dbase):
$lockfile=fopen("/tmp/blabla.lock", "w");
if (!flock($lockfile, LOCK_EX+LOCK_NB)) {
echo "Already running...\n";
exit();
}
// rest of proggy