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 # # @author: Bram Prieshof #
########################## ##########################
#Dirs
WorkDir=$(dirname $0)
LogDir=$WorkDir/logs
#Load functions #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 #ID list of excluded VM/CT's
ExcludeList=() ExcludeList=()
@@ -47,7 +54,7 @@ while true; do
UpdateAPP=true UpdateAPP=true
break;; break;;
[Bb]* ) [Bb]* )
UpdatePKG=true UpdatePKG=true
UpdateAPP=true UpdateAPP=true
break;; break;;
* ) echo "Please answer with (A)ll, (C)T`s or (V)M`s.";; * ) echo "Please answer with (A)ll, (C)T`s or (V)M`s.";;
@@ -61,10 +68,10 @@ if $UpdateCT; then
if [[ "${ExcludeList[*]}" =~ $CTID ]]; then echo "Notice: $CTID excluded"; continue; fi if [[ "${ExcludeList[*]}" =~ $CTID ]]; then echo "Notice: $CTID excluded"; continue; fi
#DEBUG echo "Task for $CTID" #DEBUG echo "Task for $CTID"
if $UpdatePKG; then if $UpdatePKG; then
CT-UpdatePackages $CTID CT-UpdatePackages $CTID | tee "$LogDir"/"$CTID"_Pkgs.log
fi fi
if $UpdateAPP; then if $UpdateAPP; then
CT-UpdateApplicatons $CTID CT-UpdateApplicatons $CTID | tee "$LogDir"/"$CTID"_Apps.log
fi fi
done done
fi fi
@@ -76,10 +83,10 @@ if $UpdateVM; then
if [[ "${ExcludeList[*]}" =~ $VMID ]]; then echo "Notice: $VMID excluded"; continue; fi if [[ "${ExcludeList[*]}" =~ $VMID ]]; then echo "Notice: $VMID excluded"; continue; fi
#DEBUG echo "Task for $VMID" #DEBUG echo "Task for $VMID"
if $UpdatePKG; then if $UpdatePKG; then
VM-UpdatePackages $VMID VM-UpdatePackages $VMID | tee "$LogDir"/"$VMID"_Pkgs.log
fi fi
if $UpdateAPP; then if $UpdateAPP; then
VM-UpdateApplicatons $VMID VM-UpdateApplicatons $VMID | tee "$LogDir"/"$VMID"_Apps.log
fi fi
done done
fi fi