templates/docker-compose/borgmatic/ - avoid losing STDERR lines

use stdbuf to change the buffereing mode to be linewise
This commit is contained in:
Nick Stokoe
2025-05-27 18:18:06 +01:00
parent 4fecd838ae
commit 5ca9ecfe2a
2 changed files with 8 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ indent() {
log() {
# Adapted from https://stackoverflow.com/a/31151808
{
"$@" 2>&1 1>&3 3>&- | indent " ! "
stdbuf -oL -eL "$@" 2>&1 1>&3 3>&- | indent " ! "
} 3>&1 1>&2 | indent " | " | tee -a "$LOGFILE"
}