Skip to content

Commit

Permalink
Redirect stderr of borg_create.
Browse files Browse the repository at this point in the history
Similar to commit 53d876d (borg_prune).

Depending on BORGBACKUP_SHOW_PROGRESS and VERBOSE variables
3 cases are there for `borg prune` to log to rear log file or not.

1. BORGBACKUP_SHOW_PROGRESS true:
   No change, same behaviour as before.
   No logging to rear log file.

2. VERBOSE true:
   stderr (2) is copied to real stderr (8)
   2 is going to rear logfile
   8 is shown becausee of VERBOSE true

3. Third case:
   stderr (2) is untouched, hence only going to rear logfile
  • Loading branch information
flyinggreenfrog committed Apr 30, 2020
1 parent 53d876d commit 0838cd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion usr/share/rear/backup/BORG/default/500_make_backup.sh
Expand Up @@ -44,8 +44,10 @@ is_true $BORGBACKUP_EXCLUDE_IF_NOBACKUP && borg_additional_options+='--exclude-i
# Start actual Borg backup.
if is_true $BORGBACKUP_SHOW_PROGRESS; then
borg_create 0<&6 1>&7 2>&8
elif is_true $VERBOSE; then
borg_create 0<&6 1>&7 2> >(tee >(cat 1>&2) >&8)
else
borg_create
borg_create 0<&6 1>&7
fi

StopIfError "Borg failed to create backup archive, borg rc $?!"

0 comments on commit 0838cd8

Please sign in to comment.