IS_BACKUPUPTODATE: add --max-depth=1 to limit the number of evaluated files

This commit is contained in:
Jérémy Lecour 2022-06-09 07:38:44 +02:00 committed by Jérémy Lecour
parent 78486611c5
commit 3d1881fe80
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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")