[find] -maxdepth should be before -type

This commit is contained in:
Alexis Ben Miloud--Josselin 2022-06-23 11:37:00 +02:00
parent 64c7cd3424
commit 40753385d1

View file

@ -750,7 +750,7 @@ check_backupuptodate() {
backup_dir="/home/backup"
if [ -d "${backup_dir}" ]; then
if [ -n "$(ls -A ${backup_dir})" ]; then
find "${backup_dir}" -type f -maxdepth 1 | while read -r file; do
find "${backup_dir}" -maxdepth 1 -type f | while read -r file; do
limit=$(date +"%s" -d "now - 2 day")
updated_at=$(stat -c "%Y" "$file")