Revert "Capture stderr in logs, too"

This reverts commit 8696f6d93f.

Yeah, this doesn't work. Syntax and intention.
This commit is contained in:
Jake Howard 2021-06-28 08:33:08 +01:00
parent 41a8fe3b4d
commit b6adc53746
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -17,7 +17,7 @@ mkdir -p "$RESTIC_LOG_DIR"
# Run backup, and capture logs to file # Run backup, and capture logs to file
cron_backup() { cron_backup() {
curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_healthchecks_id }}/start curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_healthchecks_id }}/start
restic --verbose backup {{ restic_backup_locations|join(' ') }} &> | tee -a $RESTIC_LOG_FILE restic --verbose backup {{ restic_backup_locations|join(' ') }} | tee -a $RESTIC_LOG_FILE
exit_code=${PIPESTATUS[0]} exit_code=${PIPESTATUS[0]}
curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_healthchecks_id }}/$exit_code --data-binary "@$RESTIC_LOG_FILE" curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_healthchecks_id }}/$exit_code --data-binary "@$RESTIC_LOG_FILE"
echo "Exit code: $exit_code" echo "Exit code: $exit_code"
@ -32,7 +32,7 @@ backup() {
# Run forget and prune, and capture logs to file # Run forget and prune, and capture logs to file
cron_forget() { cron_forget() {
curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_forget_healthchecks_id }}/start curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_forget_healthchecks_id }}/start
restic forget --prune $FORGET_OPTIONS &> | tee -a $RESTIC_LOG_FILE restic forget --prune $FORGET_OPTIONS | tee -a $RESTIC_LOG_FILE
exit_code=${PIPESTATUS[0]} exit_code=${PIPESTATUS[0]}
curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_forget_healthchecks_id }}/$exit_code --data-binary "@$RESTIC_LOG_FILE" curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ restic_forget_healthchecks_id }}/$exit_code --data-binary "@$RESTIC_LOG_FILE"
echo "Exit code: $exit_code" echo "Exit code: $exit_code"