Use 'xargs rm' instead of 'find -delete'

This commit is contained in:
Bruno Sutic 2017-06-04 00:52:37 +02:00
parent 241f62089a
commit 3a31bfbbb8
No known key found for this signature in database
GPG Key ID: CAFA7B1B2914ED81

View File

@ -282,7 +282,8 @@ remove_old_backups() {
# remove resurrect files older than 30 days, but keep at least 5 copies of backup. # remove resurrect files older than 30 days, but keep at least 5 copies of backup.
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 ]] || find "${files[@]}" -type f -mtime +30 -delete [[ ${#files[@]} -eq 0 ]] ||
find "${files[@]}" -type f -mtime +30 | xargs rm
} }
save_all() { save_all() {