2
0
Fork 0

sh.zio.backup: add header to logfile

main
Ducky 2024-04-02 00:23:54 +01:00
parent 5bf4386a53
commit c542314200
1 changed files with 6 additions and 1 deletions

View File

@ -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"