This commit is contained in:
2023-05-16 19:17:33 -05:00
parent c024edb797
commit 25b1663833
2 changed files with 25 additions and 2 deletions

View File

@@ -545,6 +545,23 @@ ISCSIVMSHUTDOWN(){
}
LOGROTATE(){
STOPALL_SERVICES
lm=`expr $(date +'%m') - 1`
if [ $lm = 0 ]; then
lm=12
ly=`expr $(date +'%Y') - 1`
else
ly=$(date +'%Y')
fi
ARCHIVEFOLDER=${LOGARCHIVE}/${ly}-${lm}
mkdir -p ${ARCHIVEFOLDER}
mv ${LOGFOLDER}/log* ${ARCHIVEFOLDER}/
STARTALL_SERVICES
}
TEST(){
# echo "Getting info from ${1}"
# ${FOLDER}/esxi-scripts/sys-iscsi-shutdown.ps1 ${1}
@@ -556,6 +573,8 @@ TEST(){
}
#########################################################
if [[ "${1}" != *"_service" ]] && [[ "${noheader}" != *" ${1} "* ]] && [[ "${noheader}" != *" ${2} "* ]]; then
echo
DIVIDER . lightGreen 50