X-Git-Url: https://git.sesse.net/?p=backup.sh;a=blobdiff_plain;f=backup.sh;fp=backup.sh;h=f4ae98bb0ab7dde18f3aee1df337786472ed50ae;hp=29ffa1fc17938a65831f90079d551323defd60ee;hb=d3303892e4f393d994804016060a8bc704acfebb;hpb=96d828931f444f6548a54fb379ebb64fe1830c1b diff --git a/backup.sh b/backup.sh index 29ffa1f..f4ae98b 100755 --- a/backup.sh +++ b/backup.sh @@ -68,9 +68,10 @@ infomsg() { # Trap C-c and kill trap die SIGINT SIGTERM -# Don't start if we're already running +# Don't start if we're already running. Don't use diemsg, as that removes the lock file! if [ -e $LOCKFILE ]; then - diemsg "$LOCKFILE exists for pid `cat $LOCKFILE`." + warnmsg "$LOCKFILE exists for pid `cat $LOCKFILE`." + exit 1 fi; touch $LOCKFILE echo $$ > $LOCKFILE