Update nodemgmt-scripts.sh
This commit is contained in:
@@ -577,6 +577,9 @@ BACKUP_OFFSITEPFSENSE(){
|
|||||||
mkdir ${newBAKFOLDER}
|
mkdir ${newBAKFOLDER}
|
||||||
DOM='01'
|
DOM='01'
|
||||||
DOW='1'
|
DOW='1'
|
||||||
|
DailyBackupsToKeep=14
|
||||||
|
WeeklyBackupsToKeep=12
|
||||||
|
MonthlyBackupsToKeep=24
|
||||||
|
|
||||||
ssh root@10.2.1.1 tar -c -f /cf/conf/conf_backup.tar.gz /cf/conf
|
ssh root@10.2.1.1 tar -c -f /cf/conf/conf_backup.tar.gz /cf/conf
|
||||||
scp root@10.2.1.1:/cf/conf/conf* ${newBAKFOLDER}/
|
scp root@10.2.1.1:/cf/conf/conf* ${newBAKFOLDER}/
|
||||||
@@ -596,9 +599,9 @@ BACKUP_OFFSITEPFSENSE(){
|
|||||||
mv ${newBAKFOLDER} "${newBAKFOLDER}-D"
|
mv ${newBAKFOLDER} "${newBAKFOLDER}-D"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dailyfilestokeep=(`ls -d ${BAKFOLDER}/*-D 2> /dev/null | tail -7`)
|
dailyfilestokeep=(`ls -d ${BAKFOLDER}/*-D 2> /dev/null | tail -${DailyBackupsToKeep}`)
|
||||||
weeklyfilestokeep=(`ls -d ${BAKFOLDER}/*-W 2> /dev/null | tail -4`)
|
weeklyfilestokeep=(`ls -d ${BAKFOLDER}/*-W 2> /dev/null | tail -${WeeklyBackupsToKeep}`)
|
||||||
monthlyfilestokeep=(`ls -d ${BAKFOLDER}/*-M 2> /dev/null | tail -12`)
|
monthlyfilestokeep=(`ls -d ${BAKFOLDER}/*-M 2> /dev/null | tail -${MonthlyBackupsToKeep}`)
|
||||||
for i in $(ls -d ${BAKFOLDER}/*); do keep=0
|
for i in $(ls -d ${BAKFOLDER}/*); do keep=0
|
||||||
if [[ "${i}" == *"-D"* ]]; then
|
if [[ "${i}" == *"-D"* ]]; then
|
||||||
filestokeep=${dailyfilestokeep[@]}
|
filestokeep=${dailyfilestokeep[@]}
|
||||||
|
|||||||
Reference in New Issue
Block a user