diff options
| author | kapitainsky <dariuszb@me.com> | 2019-09-28 13:32:25 +0100 |
|---|---|---|
| committer | Laurent Cozic <laurent22@users.noreply.github.com> | 2019-09-28 13:32:25 +0100 |
| commit | 27c56e96902a8f824f7e53cdf6665d40f068d75b (patch) | |
| tree | 0981003b1ac1980ee9f1baefef6c13eb5331d9e1 /rsync_tmbackup.sh | |
| parent | b460078ab03fa0501686960a500952357580ab5b (diff) | |
Fix lock to support more than one backup script running (#163)
Diffstat (limited to 'rsync_tmbackup.sh')
| -rwxr-xr-x | rsync_tmbackup.sh | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
