podman migration done, auto-update fixes

This commit is contained in:
Hartmut Bauer committed 2025-05-16 21:23:25 +02:00
1 parent bf8c226bbe
commit 03df70a244
2 files changed
+24 -4

No files matched your search

+22 -3
View File
@@ -197,15 +197,34 @@ do_start_stop_containers() {
return $rc
}
# podman auto-update nach dem Backup starten
#
# Die fn schreibt sehr viel ins Log, damit der Update ggf. nachvollzogen werden kann,
# wenn etwas daneben geht.
#
update_services() {
log $DEBUG "$DBG update_services()"
mail_log $INFO "$INF update services"
local upd=$($CONTAINER_SVC_UPDATE_USER 2>&1 | tee -a $LOG_FILE | egrep 'registry\s+true' | sed 's/^.* \([^[:space:]]*\/[^[:space:]]*\).*$/\1/g')
local old_img=$($PODMAN ps --format "table {{.ImageID}} {{.Names}} {{.Image}}" --sort names)
echo "$old_img" >>$LOG_FILE 2>&1
local plan=$($CONTAINER_SVC_UPDATE_USER --dry-run --format "{{.Image}} {{.Updated}}" 2>&1 | grep pending | sed 's/^\(.*\) pending/\1/')
local upd=$($CONTAINER_SVC_UPDATE_USER --format "table {{.Image}} {{.Updated}}" 2>&1 | tee -a $LOG_FILE | grep true | sed 's/^\(.*\) true/\1/')
check_pipe_rc ${PIPESTATUS[@]}
local rc=$?
for i in $upd; do
mail_log $INFO "$INF $i"
# warten bis alle wieder da sind (wg. ps)
sleep 20
local new_img=$($PODMAN ps --format "table {{.ImageID}} {{.Names}} {{.Image}}" --sort names)
echo "$new_img" >>$LOG_FILE 2>&1
for i in $plan; do
mail_log $INFO "$INF pending: $i"
done
for i in $upd; do
mail_log $INFO "$INF updated: $i"
done
# diff output bring zu wenig
#log $DEBUG "$DBG diff before after"
#local diff_img=$(diff <(echo "$old_img") <(echo "$new_img"))
#echo "$diff_img" >> $LOG_FILE
return $rc
}
+2 -1
View File
@@ -3,6 +3,7 @@
# entrypoint for all actions
#
# 2.2.0 16.05.2025 - fixes for auto-update, podman migration done
# 2.1.17 11.05.2025 - bugfixes, sort tar archive, split daily/cron daily
# 2.1.16 10.05.2025 - fix mail.sh, log results of auto-update
# 2.1.15 09.05.2025 - podman auto-update
@@ -16,7 +17,7 @@
# 2.1.7 29.04.2025 - 1. Schritt zur Umstellung auf podman
# 2.1.6 29.04.2025 - weekly backup Sa->SO
VER="2.1.17"
VER="2.2.0"
HERE=$(dirname "$0")
THIS_SCRIPT=$0