]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
fix long find delete old backup
authorBastian Dehn <hhaalo@arcor.de>
Sat, 24 May 2025 14:47:06 +0000 (16:47 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 24 May 2025 14:47:06 +0000 (16:47 +0200)
backup

diff --git a/backup b/backup
index 0fcc1b5b825a014e43db75df2d06713fc4cb4cf1..ea77aac0c71605557c76e46b849faa50535b5cab 100755 (executable)
--- 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)