mirror of
https://github.com/laurent22/rsync-time-backup
synced 2025-03-04 14:57:12 +00:00
Use NetBSD ps in place of pgrep to determine whether a backup is currently running.
This commit is contained in:
parent
2ba179ca7d
commit
487fd112c1
1 changed files with 6 additions and 0 deletions
|
@ -370,6 +370,12 @@ if [ -n "$(fn_find "$INPROGRESS_FILE")" ]; then
|
||||||
fn_log_error "Previous backup task is still active - aborting (command: $RUNNINGCMD)."
|
fn_log_error "Previous backup task is still active - aborting (command: $RUNNINGCMD)."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
else
|
||||||
RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")"
|
RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")"
|
||||||
if [ "$RUNNINGPID" = "$(pgrep -o -f "$APPNAME")" ]; then
|
if [ "$RUNNINGPID" = "$(pgrep -o -f "$APPNAME")" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue