update
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
VERS='4.10.68-08242023'
|
VERS='4.10.75-08242023'
|
||||||
|
|
||||||
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns '
|
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns '
|
||||||
CERT_DAEMON='/snap/bin/certbot'
|
CERT_DAEMON='/snap/bin/certbot'
|
||||||
|
|||||||
@@ -580,16 +580,28 @@ BACKUP_OFFSITEPFSENSE(){
|
|||||||
scp root@10.2.1.1:/cf/conf/conf* ${newBAKFOLDER}/
|
scp root@10.2.1.1:/cf/conf/conf* ${newBAKFOLDER}/
|
||||||
ssh root@10.2.1.1 rm -f /cf/conf/conf_backup.tar.gz
|
ssh root@10.2.1.1 rm -f /cf/conf/conf_backup.tar.gz
|
||||||
|
|
||||||
[ "${BackupsToKeep}" == "" ] && BackupsToKeep=2
|
if [ "$(date +%u)" == "1" ]; then
|
||||||
filestokeep=(`ls -d ${BAKFOLDER}/*-D | tail -${BackupsToKeep}`)
|
cp ${newBAKFOLDER} ${newBAKFOLDER/-D/-W}
|
||||||
for i in $(ls -d ${BAKFOLDER}/*-D); do
|
elif [ "$(date +%d)" == "1" ]; 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`)
|
||||||
|
for i in $(ls -d ${BAKFOLDER}/*); do
|
||||||
keep=0
|
keep=0
|
||||||
for a in ${filestokeep[@]}; do
|
if [[ "${i}" == *"-D"* ]]; then
|
||||||
|
filestokeep=${dailyfilestokeep[@]}
|
||||||
|
elif [[ "${i}" == *"-W"* ]]; then
|
||||||
|
filestokeep=${weeklyfilestokeep[@]}
|
||||||
|
elif [[ "${i}" == *"-M"* ]]; then
|
||||||
|
filestokeep=${monthlyfilestokeep[@]}
|
||||||
|
fi
|
||||||
|
for a in ${!filestokeep}; do
|
||||||
[ "${i}" == "${a}" ] && keep=1
|
[ "${i}" == "${a}" ] && keep=1
|
||||||
done;
|
done;
|
||||||
if [ $keep == 0 ]; then
|
[ $keep == 0 ] && rm -rf ${i}
|
||||||
[ "$(date +%u)" == "4" ] && mv ${i} ${i/-D/-W} || rm -rf ${i}
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user