Output error file if size is not null

This commit is contained in:
Jérémy Lecour 2023-01-04 09:13:22 +01:00 committed by Jérémy Lecour
parent 65ba8695ad
commit b1c5b693ee

View file

@ -198,9 +198,11 @@ local_tasks() {
# Remove previous error files
for error_file in $(find "${LOCAL_BACKUP_DIR}/" -type f -name '*.err' -print); do
printf "### Content of %s ###\n" "${error_file}" >&2
cat "${error_file}" >&2
printf "########################################\n" >&2
if [ $(stat -c "%s" "${error_file}") -gt 0 ]; then
printf "### Content of %s ###\n" "${error_file}" >&2
cat "${error_file}" >&2
printf "########################################\n" >&2
fi
done
log "STOP LOCAL_TASKS"