You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
699 B

.Dd 2015-10-08
.Os sbase
.Nm flock
.Nd tool to manage locks on files
.Op Fl nosux
.Ar file
.Ar cmd Op arg ...
is used to manage advisory locks on open files. It is commonly used to prevent
long running cron jobs from running in parallel. If
.Ar file
does not exist, it will be created.
.Bl -tag -width Ds
.It Fl n
Set non-blocking mode on the lock. Fail immediately if the lock
cannot be acquired.
.It Fl o
Close the file descriptor before exec to avoid having the exec'ed
program holding on to the lock.
.It Fl s
Acquire a shared lock.
.It Fl u
Release the lock.
.It Fl x
Acquire an exclusive lock. This is the default.