From 059eeff2c44b1a14e78bc8b10f611f757b4d6431 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal <40464775+daniel156161@users.noreply.github.com> Date: Sat, 22 Aug 2020 02:55:47 +0200 Subject: [PATCH] Update backup.sh --- backup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index b2a11f1..3d88272 100755 --- a/backup.sh +++ b/backup.sh @@ -65,7 +65,9 @@ if [ ! -z $keepfiles ]; then if [ ! -z $remove ]; then keepfiles=$((keepfiles + 1)) 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