From c5423142003860e85c6f021df17cdef832bb9d7f Mon Sep 17 00:00:00 2001 From: Ducky Date: Tue, 2 Apr 2024 00:23:54 +0100 Subject: [PATCH] sh.zio.backup: add header to logfile --- usr/local/bin/sh.zio.backup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr/local/bin/sh.zio.backup b/usr/local/bin/sh.zio.backup index 0d4e9ca..8eb6145 100755 --- a/usr/local/bin/sh.zio.backup +++ b/usr/local/bin/sh.zio.backup @@ -127,10 +127,15 @@ function invoke_script() { set -o pipefail exec 3>&1 + log_header="$me_filename $backup_script" + log_header_length="${#log_header}" + + script_log_path="$(create_log "$log_header\n$(repeat "-" $log_header_length)\n")" script_error_log_path="$(create_tmp_file)" + script_output=$("$backup_scripts_dir/$backup_script_filename" 2>$script_error_log_path | tee /dev/fd/3) + echo -e "$script_output" >> "$script_log_path" script_result="$?" - script_log_path="$(create_log "$script_output")" if [[ -f "$script_error_log_path" ]]; then cat "$script_error_log_path"