From 3c6e0ad5eda0124344f8f0eacb1d4fe8178554a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 8 Jan 2020 10:55:33 +0100 Subject: [PATCH] =?UTF-8?q?Uncomment=20the=20find=20commands=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xymon/tar.client.logfiles.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xymon/tar.client.logfiles.sh b/xymon/tar.client.logfiles.sh index 729c09e..40ababc 100755 --- a/xymon/tar.client.logfiles.sh +++ b/xymon/tar.client.logfiles.sh @@ -51,12 +51,12 @@ if [ ! ${match_files} -eq "0" ]; then [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : Create an archive for ${current_dir} files between ${date_start} and ${date_end} (${match_files} files) using XZ's compression level : ${xz_compression_lvl}." ## Get the list of files between the 2 dates and ignore tar files - #find . -type f -newermt "${date_start}" -not -newermt "${date_end}" -not -iname "*.tar*" -print0 | tar cJf "${tar_file_name}" --null -T - + find . -type f -newermt "${date_start}" -not -newermt "${date_end}" -not -iname "*.tar*" -print0 | tar cJf "${tar_file_name}" --null -T - ## Check previous return code and if the archive exists with size > 0 if [ "${?}" -eq "0" ] && [ -s "${tar_file_name}" ]; then [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : ${tar_file_name} successfully created, the files can be deleted." - #find . -type f -newermt "${date_start}" -not -newermt "${date_end}" -not -iname "*.tar*" -delete + find . -type f -newermt "${date_start}" -not -newermt "${date_end}" -not -iname "*.tar*" -delete fi else [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : Skip ${current_dir}, no files found between ${date_start} and ${date_end}."