Created
November 5, 2014 11:27
-
-
Save jesusgoku/5e2714b0d7abbffdeba2 to your computer and use it in GitHub Desktop.
Example to utilize flock to run script only if not previous running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
{ | |
flock -x -w 200 || exit 1 | |
yes First | |
yes Second | |
yes Third | |
} 200>~/.lock/my_yes_command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment