From 5f3873c502fe939f6c5f21bc7492fecc3df72f6c Mon Sep 17 00:00:00 2001 From: Eugene Van Dam Date: Wed, 25 Oct 2017 14:30:50 +0200 Subject: [PATCH] remove_old_backups() : replace xargs with -exec to handle 0 files found by find better --- scripts/save.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/save.sh b/scripts/save.sh index 70f663b..7ce2b99 100755 --- a/scripts/save.sh +++ b/scripts/save.sh @@ -283,7 +283,7 @@ remove_old_backups() { local -a files files=($(ls -t $(resurrect_dir)/${RESURRECT_FILE_PREFIX}_*.${RESURRECT_FILE_EXTENSION} | tail -n +6)) [[ ${#files[@]} -eq 0 ]] || - find "${files[@]}" -type f -mtime +30 | xargs rm + find "${files[@]}" -type f -mtime +30 -exec rm -v "{}" \; } save_all() {