Update pibackup.sh
This commit is contained in:
@@ -56,7 +56,12 @@ if [ "$1" != "update" ]; then
|
||||
|
||||
echo "$(date) - Removing old backups..."
|
||||
allfiles=`ls -1 ${BackupDir}/*.img.gz`
|
||||
files=(`ls -1 ${BackupDir}/*.img.gz | tail -3`)
|
||||
|
||||
if [ "${BackupsToKeep}" == "" ]; then
|
||||
BackupsToKeep=3
|
||||
fi
|
||||
|
||||
files=(`ls -1 ${BackupDir}/*.img.gz | tail -${BackupsToKeep}`)
|
||||
for i in $allfiles; do keep=0;
|
||||
for a in ${files[@]}; do
|
||||
if [ $i == $a ]; then keep=1; fi;
|
||||
|
||||
Reference in New Issue
Block a user