Merge pull request #210 from eugenevd/20171014-remove_old_backups-find

remove_old_backups() : replace xargs with -exec to handle 0 files found better
This commit is contained in:
Bruno Sutic 2017-10-26 14:06:11 +04:00 committed by GitHub
commit 9c7ec631d4

View File

@ -283,7 +283,7 @@ remove_old_backups() {
local -a files local -a files
files=($(ls -t $(resurrect_dir)/${RESURRECT_FILE_PREFIX}_*.${RESURRECT_FILE_EXTENSION} | tail -n +6)) files=($(ls -t $(resurrect_dir)/${RESURRECT_FILE_PREFIX}_*.${RESURRECT_FILE_EXTENSION} | tail -n +6))
[[ ${#files[@]} -eq 0 ]] || [[ ${#files[@]} -eq 0 ]] ||
find "${files[@]}" -type f -mtime +30 | xargs rm find "${files[@]}" -type f -mtime +30 -exec rm -v "{}" \;
} }
save_all() { save_all() {