Re: Lock files in scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



--On Wednesday, July 13, 2011 12:35 PM -0600 Devin Reade <gdr@xxxxxxx> 
wrote:

> However, although I like the trap mechanism for dealing with cleaning
> up temporary files (especially those files or directories containing
> temporary files created by mktemp(1)), I don't think that it's the
> right tool for lock files.  Instead, have a look at flock(1) to avoid
> the race conditions.  (See flock(2) about its unsuitability for locks
> on NFS filesystems, though.)

Thanks, that looks much better.

<http://linux.die.net/man/1/flock>

I'm running my script as a normal user so the lock will be in the user's 
home directory.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux