Skip to content

Instantly share code, notes, and snippets.

LOCK=/tmp/shardbackup.lock
if [ -f $LOCK ]; then
ps -p `cat $LOCK` > /dev/null
if [ $? -eq 1 ]; then
# Stale lock file
rm $LOCK
else
echo "Lock file found for running process"
exit 1