Update pfsense-backup.sh

This commit is contained in:
2020-08-22 01:48:32 +02:00
committed by GitHub
parent 2ad1381805
commit c0c34ed0b7
+4 -1
View File
@@ -66,7 +66,10 @@ if [ $cron -eq 1 ]; then
else
do_backup
if [ ! -z $keepfiles ]; then
ls -d -1tr $destination/*.xml | head -n -$keepfiles | xargs -d '\n' rm -f
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)
fi
fi
fi
else