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}."