check_backupuptodate: use find with --max-depth=1 to limit the number of evaluated files

This commit is contained in:
Jérémy Dubois 2022-08-04 16:35:29 +02:00
parent 271e8623b4
commit f2f3155fc3
2 changed files with 2 additions and 1 deletions

View file

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

View file

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