From f2f3155fc35c492fa413d452d8ce1d5c468fe1d9 Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Thu, 4 Aug 2022 16:35:29 +0200 Subject: [PATCH] check_backupuptodate: use find with --max-depth=1 to limit the number of evaluated files --- CHANGELOG | 1 + evocheck.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 0de3763..587ca20 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - check_evobackup_exclude_mount : skip if --one-file-system is used, and exclude scripts without Rsync command +- check_backupuptodate: use find with --max-depth=1 to limit the number of evaluated files ## [22.08] - 2022-08-04 diff --git a/evocheck.sh b/evocheck.sh index 1c37691..b5a8276 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -126,7 +126,7 @@ check_backupuptodate(){ backup_dir="/home/backup" if [ -d "${backup_dir}" ]; then if [ -n "$(ls -A ${backup_dir})" ]; then - for file in "${backup_dir}"/*; do + find "${backup_dir}" -maxdepth 1 -type f | while read -r file; do limit=$(($(date +"%s") - 172800)) updated_at=$(stat -f "%m" "$file")