flock.1 (700B)
1 .Dd October 8, 2015 2 .Dt FLOCK 1 3 .Os sbase 4 .Sh NAME 5 .Nm flock 6 .Nd tool to manage locks on files 7 .Sh SYNOPSIS 8 .Nm 9 .Op Fl nosux 10 .Ar file 11 .Ar cmd Op arg ... 12 .Sh DESCRIPTION 13 .Nm 14 is used to manage advisory locks on open files. 15 It is commonly used to prevent long running cron jobs from running in 16 parallel. 17 If 18 .Ar file 19 does not exist, it will be created. 20 .Sh OPTIONS 21 .Bl -tag -width Ds 22 .It Fl n 23 Set non-blocking mode on the lock. 24 Fail immediately if the lock cannot be acquired. 25 .It Fl o 26 Close the file descriptor before exec to avoid having the exec'ed 27 program holding on to the lock. 28 .It Fl s 29 Acquire a shared lock. 30 .It Fl u 31 Release the lock. 32 .It Fl x 33 Acquire an exclusive lock. 34 This is the default. 35 .El