4 06 2017
Bash: preventing multiple concurrent executions
I’ve found all kinds of solutions achieving this, but this is the nicest solution i’ve seen so far:
#!/bin/bash exec 200<$0 flock -n 200 || exit 1 echo "sleep begin"; sleep 10 echo "sleep end";
found on ... https://stackoverflow.com/questions/7057234/bash-flock-exit-if-cant-acquire-lock/7305448#7305448
See also: https://blog.famzah.net/2013/07/31/using-flock-in-bash-without-invoking-a-subshell/
GNU/Linux: finding duplicate files (by content) … Enable desktop sharing in Ubuntu Desktop (“Freigabe der Arbeitsfläche”) VNC RDP
Comments are currently closed.