Wiggins d'Anconia wrote: > > In general this would be handled with a lock file. When the first > instance of your script starts it would check for the lock file if it > exists then just exit, if it doesn't then it opens a file (.lock for > example) then does its processing, and then removes the lock just before > exiting. If another instance of the script starts while the lock file > exists it will see it and close. > > For example: > > my $lockfile = '.lock'; > > exit if (-e $lockfile); > > # try to get the pid file...." > open(LOCK, ">$lockfile") or die "unable to open lock file: $!"; > print LOCK $$; > close(LOCK) or die "unable to close lock file: $!"; > > # do processing here..... > > unlink $lockfile or die "unable to remove lock file: $!";
Good idea, but I think the lock file in this case needs a little more information--specificically, the ip address currently being inserted into the blacklist file. That way, if the new ip in the queue is identical to the one being inserted, the insertion is dropped, but if the ip is different, it waits in the queue to be added next. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]