[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] flock
- Subject: [ale] flock
- From: jkinney at localnetsolutions.com (James P. Kinney III)
- Date: Sun, 25 Mar 2007 23:35:31 -0400
I need to put an exclusive lock on a couple of files during a process to
make sure they are not written to during the script run. I'm unclear on
the use of flock within bash.
What I _want_ to do is
lock file(s)
extract data from the locked file
do more stuff (i.e. get mtime on locked file, etc)
unlock file(s)
Reading the man pages on flock are not helping. It _looks_ like:
flock -x <file-to-lock> -c <external-script-that-processes-stuff>
will do it but I can't figure out a way to test this.
--
James P. Kinney III
CEO & Director of Engineering
Local Net Solutions,LLC
770-493-8244
http://www.localnetsolutions.com
GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
- Follow-Ups:
- [ale] flock
- From: jkinney at localnetsolutions.com (James P. Kinney III)