From 3de5101a6a0f9fac2b421ae66923cbc389d8f771 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2014 16:53:41 +0200 Subject: [PATCH] Exit if another instance is already running --- backmeupscotty | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backmeupscotty b/backmeupscotty index d1500c1..0af4cd5 100644 --- a/backmeupscotty +++ b/backmeupscotty @@ -5,6 +5,11 @@ REMOTE_BASE=/tmp/backmeupscotty ARCHIVE_KEEPNBACKUPS=30 ARCHIVE_KEEPNDAYS=30 +if [ $(pidof -x $(basename $0) | wc -w) -gt 2 ]; then + echo BACKMEUPSCOTTY: Another instance of $(basename $0) is already running! >&2 + exit 1 +fi + while getopts ":q" opt; do case $opt in q) -- 2.39.5