From 3d1881fe806ef78624506354adcda32d7beba1b9 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 9 Jun 2022 07:38:44 +0200 Subject: [PATCH] IS_BACKUPUPTODATE: add --max-depth=1 to limit the number of evaluated files --- CHANGELOG | 2 ++ evocheck.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index f4cf4ce..a6b2483 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp ### Changed +* IS_BACKUPUPTODATE: add --max-depth=1 to limit the number of evaluated files + ### Deprecated ### Removed diff --git a/evocheck.sh b/evocheck.sh index 5b1afb0..979e7bb 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -744,7 +744,7 @@ check_backupuptodate() { if [ -n "$(ls -A ${backup_dir})" ]; then # Look for all files, including subdirectories. # If this turns out to be problematic, we can go back to first level only, with --max-depth=1 - find "${backup_dir}" -type f | while read -r file; do + find "${backup_dir}" -type f --max-depth=1 | while read -r file; do limit=$(date +"%s" -d "now - 2 day") updated_at=$(stat -c "%Y" "$file")