From: Bastian Dehn Date: Sat, 24 May 2025 14:47:06 +0000 (+0200) Subject: fix long find delete old backup X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=2b5ca148621b8241cb4bc7fc8c21003340fc3a4b;p=simple-backup.git fix long find delete old backup --- diff --git a/backup b/backup index 0fcc1b5..ea77aac 100755 --- a/backup +++ b/backup @@ -119,10 +119,7 @@ remove_backup_dir() local backup_name="$2" local delete_count=$3 - local backups=$(ls --directory $backup_path/*/ \ - | grep "_$backup_name" \ - --max-count=$delete_count); - local backups=$(find $backup_path -name "*$backup_name" \ + local backups=$(find $backup_path -maxdepth 1 -name "*$backup_name" \ | sort \ | head --lines $delete_count)