Uncomment the find commands…

This commit is contained in:
Jeremy Gardais 2020-01-08 10:55:33 +01:00
parent ee6bd3a194
commit 3c6e0ad5ed
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 2 additions and 2 deletions

View File

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