From 725f5e3095427f31fa43025519396d488d438f29 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 24 Aug 2023 19:57:30 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 62607aa9..01b4116f 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -582,9 +582,10 @@ BACKUP_OFFSITEPFSENSE(){ [ "${BackupsToKeep}" == "" ] && BackupsToKeep=2 files=(`ls -1 ${BAKFOLDER}/* | tail -${BackupsToKeep}`) - for i in $(ls -1 ${BAKFOLDER}/*); do keep=0; + for i in $(ls -1 ${BAKFOLDER}/*); do + keep=0 for a in ${files[@]}; do - if [ $i == $a ]; then keep=1; fi; + [ $i == $a ] && keep=1 done; if [ $keep == 0 ]; then echo "$(date) - REMOVING : $i"