From 4cdcb4be97e5def18a722a36d69ec40f67ddfe11 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal <40464775+daniel156161@users.noreply.github.com> Date: Sat, 22 Aug 2020 02:57:48 +0200 Subject: [PATCH] Update pfsense-backup.sh --- pfsense-backup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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