diff options
| author | William D. Jones <thor0505@comcast.net> | 2018-06-13 14:11:27 +0000 |
|---|---|---|
| committer | William D. Jones <thor0505@comcast.net> | 2018-06-13 18:54:57 +0000 |
| commit | 487fd112c11f29b25f2c4a34d0cccf36a713a97e (patch) | |
| tree | e1a48740b8a6d4a56632dd9694869aafd8269145 | |
| parent | 2ba179ca7dc4ff910728c73878ac09eb7475c463 (diff) | |
Use NetBSD ps in place of pgrep to determine whether a backup is currently running.
| -rwxr-xr-x | rsync_tmbackup.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh index 3a634f8..a8723e7 100755 --- a/rsync_tmbackup.sh +++ b/rsync_tmbackup.sh @@ -370,6 +370,12 @@ if [ -n "$(fn_find "$INPROGRESS_FILE")" ]; then fn_log_error "Previous backup task is still active - aborting (command: $RUNNINGCMD)." exit 1 fi + elif [[ "$OSTYPE" == "netbsd"* ]]; then + RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")" + if ps -axp "$RUNNINGPID" -o "command" | grep "$APPNAME" > /dev/null; then + fn_log_error "Previous backup task is still active - aborting." + exit 1 + fi else RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")" if [ "$RUNNINGPID" = "$(pgrep -o -f "$APPNAME")" ]; then |
