Use NetBSD ps in place of pgrep to determine whether a backup is currently running.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user