From owner-freebsd-questions Sun May 10 20:58:54 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA03176 for freebsd-questions-outgoing; Sun, 10 May 1998 20:58:54 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA03158 for ; Sun, 10 May 1998 20:58:50 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.8) with SMTP id UAA02622; Sun, 10 May 1998 20:58:50 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Date: Sun, 10 May 1998 20:58:50 -0700 (PDT) From: Doug White Reply-To: Doug White To: kf7nn@kf7nn.com cc: questions@FreeBSD.ORG Subject: Re: cqcam script In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 10 May 1998 kf7nn@kf7nn.com wrote: > so what method do you suggest to lock the file? Before you do your stuff, create a zero-length file (using `touch'). If the file already exists, then exit without doing anything. When you're done doing your stuff, then remove the file. This keeps only one script running at a time. If you have procmail installed then use the `lockfile' command -- it does a better job of lockfile management. This little sh snippet is a very simple lockfile-managed script: if [ ! -x file ] touch file # do your stuff rm file fi Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message