From 27c56e96902a8f824f7e53cdf6665d40f068d75b Mon Sep 17 00:00:00 2001 From: kapitainsky Date: Sat, 28 Sep 2019 13:32:25 +0100 Subject: Fix lock to support more than one backup script running (#163) --- rsync_tmbackup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh index ca9f300..addda70 100755 --- a/rsync_tmbackup.sh +++ b/rsync_tmbackup.sh @@ -428,7 +428,8 @@ if [ -n "$(fn_find "$INPROGRESS_FILE")" ]; then fi else RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")" - if [ "$RUNNINGPID" = "$(pgrep -o -f "$APPNAME")" ]; then + if ps -p "$RUNNINGPID" -o command | grep "$APPNAME" + then fn_log_error "Previous backup task is still active - aborting." exit 1 fi -- cgit v1.2.3