Update nodemgmt-scripts.sh

This commit is contained in:
2023-08-24 19:57:30 -05:00
parent 416d9331be
commit 725f5e3095

View File

@@ -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"