Skip to content

Instantly share code, notes, and snippets.

@jeffreyiacono
Created October 15, 2012 05:06
Show Gist options
  • Select an option

  • Save jeffreyiacono/3890885 to your computer and use it in GitHub Desktop.

Select an option

Save jeffreyiacono/3890885 to your computer and use it in GitHub Desktop.
Flocker
#! /bin/sh
die() {
echo $1
exit 1
}
(
flock -n 9 || die "couldn't acquire ze lock"
echo "starting ..."
sleep 10
echo "ending ..."
) 9>/var/lock/test_lock
@rkm3
Copy link
Copy Markdown

rkm3 commented Oct 15, 2012

aha, flock is not about birds = f-lock = file lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment