Added logging for UpdateAll sh

This commit is contained in:
2022-06-23 15:08:10 +02:00
parent f58f6a2953
commit 2b88178caf
2 changed files with 14 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
logs/*

View File

@@ -6,8 +6,15 @@
# @author: Bram Prieshof #
##########################
#Dirs
WorkDir=$(dirname $0)
LogDir=$WorkDir/logs
#Load functions
source $(dirname $0)/functions.sh
source $WorkDir/functions.sh
#Create Log folder
if [ ! -d $LogDir ]; then
mkdir $LogDir
fi
#ID list of excluded VM/CT's
ExcludeList=()
@@ -61,10 +68,10 @@ if $UpdateCT; then
if [[ "${ExcludeList[*]}" =~ $CTID ]]; then echo "Notice: $CTID excluded"; continue; fi
#DEBUG echo "Task for $CTID"
if $UpdatePKG; then
CT-UpdatePackages $CTID
CT-UpdatePackages $CTID | tee "$LogDir"/"$CTID"_Pkgs.log
fi
if $UpdateAPP; then
CT-UpdateApplicatons $CTID
CT-UpdateApplicatons $CTID | tee "$LogDir"/"$CTID"_Apps.log
fi
done
fi
@@ -76,10 +83,10 @@ if $UpdateVM; then
if [[ "${ExcludeList[*]}" =~ $VMID ]]; then echo "Notice: $VMID excluded"; continue; fi
#DEBUG echo "Task for $VMID"
if $UpdatePKG; then
VM-UpdatePackages $VMID
VM-UpdatePackages $VMID | tee "$LogDir"/"$VMID"_Pkgs.log
fi
if $UpdateAPP; then
VM-UpdateApplicatons $VMID
VM-UpdateApplicatons $VMID | tee "$LogDir"/"$VMID"_Apps.log
fi
done
fi