Update pfsense-backup.sh

This commit is contained in:
2020-08-22 02:31:43 +02:00
committed by GitHub
parent c84a5702b2
commit 0d17d59791
+4 -1
View File
@@ -68,7 +68,10 @@ if [ $cron -eq 1 ]; then
if [ ! -z $keepfiles ]; then
remove=$(ls -d -1tr $destination/*.xml | tail -n +$keepfiles | head -n1)
if [ ! -z $remove ]; then
rm -f $(ls -d -1tr $destination/*.xml | tail -n -$keepfiles | head -n1)
keepfiles=$((keepfiles + 1))
del=$(ls $destination/*.xml | tail -n -$keepfiles | head -n1)
rm -f $del
echo "Backup removed at $del"
fi
fi
fi