Skip to content

Commit 3fe4c15

Browse files
committed
use grep -q instead of discarding the output
grep -q seems quite portable and stops directly at the first match
1 parent cd2a243 commit 3fe4c15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rsync_tmbackup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ MYPID="$$"
348348
if [ ! -d "$LOG_DIR" ]; then
349349
fn_log_info "Creating log folder in '$LOG_DIR'..."
350350
mkdir -- "$LOG_DIR"
351-
fi
351+
i
352352

353353
# -----------------------------------------------------------------------------
354354
# Handle case where a previous backup failed or was interrupted.
@@ -377,7 +377,7 @@ if [ -n "$(fn_find "$INPROGRESS_FILE")" ]; then
377377
fi
378378

379379
RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")"
380-
if ps -${PSFLAGS}p "$RUNNINGPID" -o "command" | grep "$APPNAME" > /dev/null; then
380+
if ps -${PSFLAGS}p "$RUNNINGPID" -o "command" | grep -q "$APPNAME"; then
381381
fn_log_error "Previous backup task is still active - aborting."
382382
exit 1
383383
fi

0 commit comments

Comments
 (0)