Update nodemgmt-scripts.sh

This commit is contained in:
2023-08-24 21:29:15 -05:00
parent 778d321bed
commit f61cf7a4d0

View File

@@ -580,15 +580,15 @@ BACKUP_OFFSITEPFSENSE(){
scp root@10.2.1.1:/cf/conf/conf* ${newBAKFOLDER}/
ssh root@10.2.1.1 rm -f /cf/conf/conf_backup.tar.gz
if [ "$(date +%u)" == "1" ]; then
if [ "$(date +%u)" == "4" ]; then
cp ${newBAKFOLDER} ${newBAKFOLDER/-D/-W}
elif [ "$(date +%d)" == "1" ]; then
elif [ "$(date +%d)" == "24" ]; then
cp ${newBAKFOLDER} ${newBAKFOLDER/-D/-M}
fi
dailyfilestokeep=(`ls -d ${BAKFOLDER}/*-D | tail -2`)
weeklyfilestokeep=(`ls -d ${BAKFOLDER}/*-W | tail -2`)
monthlyfilestokeep=(`ls -d ${BAKFOLDER}/*-M | tail -2`)
dailyfilestokeep=(`ls -d ${BAKFOLDER}/*-D | tail -2`) >/dev/null 2>&1
weeklyfilestokeep=(`ls -d ${BAKFOLDER}/*-W | tail -2`) >/dev/null 2>&1
monthlyfilestokeep=(`ls -d ${BAKFOLDER}/*-M | tail -2`) >/dev/null 2>&1
for i in $(ls -d ${BAKFOLDER}/*); do
keep=0
if [[ "${i}" == *"-D"* ]]; then