From d2b5e675b24dcfda14c1ed9a878a99bd710c4714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Sun, 24 Jul 2016 15:44:17 +0200 Subject: Report what failed --- backuper.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backuper.sh b/backuper.sh index ce4d2a8..eac86aa 100644 --- a/backuper.sh +++ b/backuper.sh @@ -184,7 +184,7 @@ add_stage() { [ ! -p "$RUNDIR"/fifo_"$NEXTSTAGE" ] && mkfifo "$RUNDIR"/fifo_"$NEXTSTAGE" ## Run requested command and store PID - $@ > "$RUNDIR"/fifo_"$NEXTSTAGE" < "$RUNDIR"/fifo_"$STAGE" || die & + $@ > "$RUNDIR"/fifo_"$NEXTSTAGE" < "$RUNDIR"/fifo_"$STAGE" || die "One of the pipeline commands failed" & echo "$!" >> "$RUNDIR"/"$PID_FILE" ## Process started - increment @@ -216,10 +216,10 @@ start_pipeline() { ## ... and it takes 100% CPU. So, for now: Do not use mbuffer as the last one. #add_stage "mbuffer -q -m 100M" - start_store || die & + start_store || die "Store command failed" & PID_STORE=$! - start_command || die & + start_command || die "Backup command failed" & PID_GENERATE=$! wait "$PID_STORE" "$PID_GENERATE" -- cgit v1.2.3