From 1aeadd04a6094e29e40350a537c1080dc40d5150 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 16 Dec 2022 14:17:13 -0600 Subject: [PATCH] Update pibackup.sh --- pibackup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pibackup.sh b/pibackup.sh index 58d4c61..f3dc63a 100755 --- a/pibackup.sh +++ b/pibackup.sh @@ -56,13 +56,13 @@ if [ "$1" != "update" ]; then [ $TEST != true ] && sleep 1m echo "$(date) - Removing old backups..." - allfiles=`ls -1 ${BackupDir}/*.img.gz` + allfiles=`ls -1 ${BackupDir}/*.img*` if [ "${BackupsToKeep}" == "" ]; then BackupsToKeep=3 fi - files=(`ls -1 ${BackupDir}/*.img.gz | tail -${BackupsToKeep}`) + files=(`ls -1 ${BackupDir}/*.img* | tail -${BackupsToKeep}`) for i in $allfiles; do keep=0; for a in ${files[@]}; do if [ $i == $a ]; then keep=1; fi;