Skip to content

Instantly share code, notes, and snippets.

@duderamos
Last active September 27, 2017 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duderamos/52244763dc4788128ccc1d4af5f719e1 to your computer and use it in GitHub Desktop.
Save duderamos/52244763dc4788128ccc1d4af5f719e1 to your computer and use it in GitHub Desktop.
# If a second instance of this script starts, it won't run the command and exit with 1.
flock -n /tmp/.process-name.lock <long command with args here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment