]> git.treefish.org Git - backmeupscotty.git/blobdiff - backmeupscotty
Exit if another instance is already running
[backmeupscotty.git] / backmeupscotty
index d1500c1c3d15d7bce4384d9fbd23e033a2cc2f5c..0af4cd5927c371d515f45d36c9241945e6d2bbfd 100644 (file)
@@ -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)