getlock

  66 downloads
0.3 GPL (GNU General Public License)    
  UNRATED
A simple and easy to use command-line file locking program for Linux and UNIX OSes

description

download

specifications

changelog

Getlock is an open source, simple and free command-line file locking application, which can lock one or more lockfiles, and then run a shell command.

getlock features several advanced options, allowing users to just lock files, to run a command when it can't lock the file, to kill off the current holder of the lockfile, etc. Below we've listed some examples of use, courtesy of the project's home page:

Lock Multiple files then run program, fail instantly if can't lock:
 getlock /tmp/file1.lck /tmp/file2.lck "echo hello"

Try for 1 minute to lock a file, run program '/tmp/lockfail.sh' if can't get lock:
 getlock -w -t 60 /tmp/file1.lck -F "/tmp/lockfail.sh" "echo got lock"

Kill owner of lockfile after waiting 30 secs:
 getlock -w -g 30 -k /var/lock/file1.lck "echo got lock"

Just lock files, don't run a program:
 getlock -w -N /var/lock/file1.lck /tmp/file2.lck

Run program even if can't get lock:
 getlock -w -t 30 -X /tmp/file1.lck "/usr/sbin/program-that-must-run.sh"

Lock 3 files, do not write PID to the last of these:
 getlock -w /tmp/lockfile1.lck /var/lock/lockfile2.lck -s /home/colum/MyWork.txt "vi /home/colum/MyWork.txt"
read more   
Last updated on September 26th, 2013
3  
getlock - Usage example and help menu of the getlock software, as viewed from the Linux Terminalgetlock - Usage example and help menu of the getlock software, as viewed from the Linux Terminalgetlock - Usage example and help menu of the getlock software, as viewed from the Linux Terminal

0 User reviews so far.

SUBMIT