lock snippets

Advisory locks in Linux

Tagged advisory, flock, lock  Languages bash

Use Linux advisory locks to prevent concurrent execution of scripts:

flock -nx /var/lock/scriptx scriptx.sh