diff --git a/pfsense-backup.sh b/pfsense-backup.sh index 8835b16..428a554 100755 --- a/pfsense-backup.sh +++ b/pfsense-backup.sh @@ -69,8 +69,10 @@ if [ $cron -eq 1 ]; then remove=$(ls -d -1tr $destination/*.xml | tail -n +$keepfiles | head -n1) if [ ! -z $remove ]; then del=$(ls $destination/*.xml | head -n -$keepfiles) - rm -f $del - echo "Backup removed at $del" + if [ ! -z $del ]; then + rm -f $del + echo "Backup removed at $del" + fi fi fi fi