Update pfsense-backup.sh

This commit is contained in:
2020-08-22 02:57:48 +02:00
committed by GitHub
parent 45acb9d50b
commit 4cdcb4be97
+2
View File
@@ -69,11 +69,13 @@ if [ $cron -eq 1 ]; then
remove=$(ls -d -1tr $destination/*.xml | tail -n +$keepfiles | head -n1) remove=$(ls -d -1tr $destination/*.xml | tail -n +$keepfiles | head -n1)
if [ ! -z $remove ]; then if [ ! -z $remove ]; then
del=$(ls $destination/*.xml | head -n -$keepfiles) del=$(ls $destination/*.xml | head -n -$keepfiles)
if [ ! -z $del ]; then
rm -f $del rm -f $del
echo "Backup removed at $del" echo "Backup removed at $del"
fi fi
fi fi
fi fi
fi
else else
do_backup do_backup
fi fi