#   3. Pull updates locally          — if WEEKLY_SYNC_UPDATES=true (zero extra downtime)
#   4. Pull updates remotely         — if WEEKLY_SYNC_UPDATES_REMOTE=true
#   5. rsync WEEKLY_SYNC_SHARES      — full clean mirror, containers stopped both sides
#   6. Start remote containers       — correct order, delayed start respected
#   7. Start local containers        — correct order, delayed start respected

#   3. Pull updates locally          — if WEEKLY_SYNC_UPDATES=true (zero extra downtime)
#   4. Pull updates remotely         — if WEEKLY_SYNC_UPDATES_REMOTE=true
#   5. rsync WEEKLY_SYNC_SHARES      — full clean mirror, containers stopped both sides
#   6. Start remote containers       — correct order, delayed start respected
#   7. Start local containers        — rebuild if new image pulled, docker start otherwise


The file /boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh has been updated successfully. (file state is current in your context — no need to Read it back)

#   3. Pull updates locally          — if WEEKLY_SYNC_UPDATES=true (zero extra downtime)
#   4. Pull updates remotely         — if WEEKLY_SYNC_UPDATES_REMOTE=true
#   5. rsync WEEKLY_SYNC_SHARES      — full clean mirror, containers stopped both sides
#   6. Start remote containers       — correct order, delayed start respected
#   7. Start local containers        — correct order, delayed start respected

#   3. Pull updates locally          — if WEEKLY_SYNC_UPDATES=true (zero extra downtime)
#   4. Pull updates remotely         — if WEEKLY_SYNC_UPDATES_REMOTE=true
#   5. rsync WEEKLY_SYNC_SHARES      — full clean mirror, containers stopped both sides
#   6. Start remote containers       — correct order, delayed start respected
#   7. Start local containers        — rebuild if new image pulled, docker start otherwise

-#   7. Start local containers        — correct order, delayed start respected

+#   7. Start local containers        — rebuild if new image pulled, docker start otherwise

#   8. WEEKLY_MAINTENANCE_SCRIPTS    — weekly restarts etc. (docker_weekly_restart.sh)

#   9. docker_update.sh --remainder  — update all containers not in daily or weekly sync window


The root cause: `docker pull` was updating the image on disk, but `docker start` ignores that — it re-runs the container using the image SHA baked in at creation time. So Emby, Mariadb-Authelia, Mariadb-Authelia-Secondary, Redis-Authelia, and Redis-Authelia-Secondary were having their images pulled every week and immediately discarded.

What changed:

- **Weekly sync window** now tracks the digest before and after each `docker pull`. If the digest changed, the container goes into `_weekly_needs_rebuild`. After rsync completes, those containers get `platform_rebuild_container` (recreates from XML template on the new image) instead of `docker start` (which would silently re-use the old SHA).
- **`docker_update_remaining.sh` removed** from `WEEKLY_MAINTENANCE_SCRIPTS` — it was running before the hardcoded remainder step and consuming all available updates, leaving nothing for the second pass.
- **`WEEKLY_RESTART_CONTAINERS` added** to the remainder exclusion list in `docker_update.sh --remainder` — those containers are managed by `docker_weekly_restart.sh`, the remainder step shouldn't race with them.

Next weekly run (Sunday 2:30am) Emby, both Mariadbs, and both Redises will actually land on their new images.


no half the containers need updates and were not touched, this system has been running unraid for 5 or 6 years


Run docker network script during onboarding


so we have 2 update scripts do we need both or can we condense down to one, maybe with a extra arg or 2


Let me check where each script is actually called from now:


Bash

grep -rn "docker_update_remaining\|docker_update\.sh" /boot/config/plugins/varaverk --include="*.sh" --include="*.conf" --include="*.php" | grep -v ".git" | grep -v "claude-data" | grep -v "^Binary"

Find all references to both update scripts


/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:74:#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:290:#   6. docker_update.sh              pull latest images for DAILY_RESTART_CONTAINERS (no downtime)
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:333:#  10. docker_update_remaining.sh pull latest images for all containers not in daily/weekly lists
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:656:# docker_update.sh — pull latest images for daily restart containers, no downtime
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:663:# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:664:# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:665:# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:667:# docker_update_remaining.sh — pull latest images for all containers not in daily/weekly lists
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:671:# Together with docker_update.sh and the weekly image pull: every deployed container gets
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:675:# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --dry-run
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:676:# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --status
/boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh:677:# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh
/boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh:17:#   9. docker_update.sh --remainder  — update all containers not in daily or weekly sync window
/boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh:381:DOCKER_UPDATE_SCRIPT="$SCRIPTS_ROOT/Docker_Essentials/docker_update.sh"
/boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh:383:    warn "docker_update.sh not found — skipping remainder updates"
/boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh:384:    JOB_FAIL+=("docker_update.sh --remainder")
/boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh:390:        JOB_PASS+=("docker_update.sh --remainder")
/boot/config/plugins/varaverk/Orchestrators/weekly_sync_maintenance.sh:393:        JOB_FAIL+=("docker_update.sh --remainder")
/boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh:109:# docker_update.sh
/boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh:112:# docker_update.sh --remainder
/boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh:116:# docker_update.sh --dry-run
/boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh:119:# docker_update.sh --status
/boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh:122:# docker_update.sh --log
/boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh:169:    # Daily containers — updated by docker_update.sh normal mode
/boot/config/plugins/varaverk/Docker_Essentials/docker_daily_restart.sh:12:# that is already happening. Also drives docker_update.sh in normal mode: the
/boot/config/plugins/varaverk/Docker_Essentials/docker_daily_restart.sh:66:#       Containers restarted nightly. Also used by docker_update.sh normal mode
/boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh:16:# Together with docker_update.sh (normal + remainder modes), every deployed
/boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh:69:# docker_update_remaining.sh
/boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh:72:# docker_update_remaining.sh --dry-run
/boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh:75:# docker_update_remaining.sh --status
/boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh:78:# docker_update_remaining.sh --log
/boot/config/plugins/varaverk/Configurations/master.conf:377:        "Docker_Essentials/docker_update.sh"          # pull container image updates before restart


`docker_update_remaining.sh` is now only referenced in comments/docs — nothing calls it. `docker_update.sh --remainder` already covers everything it did, with better exclusion logic.

One gap: `--remainder` mode doesn't check the `WEEKLY_REMAINING_UPDATES` toggle. I'll add that, then delete the redundant file and clean up the docs.


Edit

if [[ "$REMAINDER_MODE" == true ]]; then
    declare -A _exclude=()

if [[ "$REMAINDER_MODE" == true ]]; then
    if [[ "${WEEKLY_REMAINING_UPDATES:-true}" != "true" ]]; then
        echo "WEEKLY_REMAINING_UPDATES=false — skipping remainder container updates"
        exit 0
    fi

    declare -A _exclude=()


The file /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh has been updated successfully. (file state is current in your context — no need to Read it back)

if [[ "$REMAINDER_MODE" == true ]]; then
    declare -A _exclude=()

if [[ "$REMAINDER_MODE" == true ]]; then
    if [[ "${WEEKLY_REMAINING_UPDATES:-true}" != "true" ]]; then
        echo "WEEKLY_REMAINING_UPDATES=false — skipping remainder container updates"
        exit 0
    fi

    declare -A _exclude=()

+    if [[ "${WEEKLY_REMAINING_UPDATES:-true}" != "true" ]]; then

+        echo "WEEKLY_REMAINING_UPDATES=false — skipping remainder container updates"

# Daily containers — updated by docker_update.sh normal mode


Now update the docblock at the top to document `WEEKLY_REMAINING_UPDATES`:


# master.conf
#
#   DAILY_CONTAINER_UPDATES
#       Enable or disable normal mode. docker_daily_restart.sh runs regardless.
#       (default: true)
#
#   PROFILE_CRITICAL_CONTAINER_NAMES[emby|critical-data]
#       Container names for emby and critical-data profiles — excluded from
#       remainder mode (already updated by the weekly sync window)

# master.conf
#
#   DAILY_CONTAINER_UPDATES
#       Enable or disable normal mode. docker_daily_restart.sh runs regardless.
#       (default: true)
#
#   WEEKLY_REMAINING_UPDATES
#       Enable or disable remainder mode. (default: true)
#
#   PROFILE_CRITICAL_CONTAINER_NAMES[emby|critical-data]
#       Container names for emby and critical-data profiles — excluded from
#       remainder mode (already updated by the weekly sync window)


# master.conf
#
#   DAILY_CONTAINER_UPDATES
#       Enable or disable normal mode. docker_daily_restart.sh runs regardless.
#       (default: true)
#
#   PROFILE_CRITICAL_CONTAINER_NAMES[emby|critical-data]
#       Container names for emby and critical-data profiles — excluded from
#       remainder mode (already updated by the weekly sync window)

# master.conf
#
#   DAILY_CONTAINER_UPDATES
#       Enable or disable normal mode. docker_daily_restart.sh runs regardless.
#       (default: true)
#
#   WEEKLY_REMAINING_UPDATES
#       Enable or disable remainder mode. (default: true)
#
#   PROFILE_CRITICAL_CONTAINER_NAMES[emby|critical-data]
#       Container names for emby and critical-data profiles — excluded from
#       remainder mode (already updated by the weekly sync window)

+#       Enable or disable remainder mode. (default: true)


Now delete the redundant script and clean up the user_script_plug-in.sh docs:


Bash

Delete docker_update_remaining.sh


(Bash completed with no output)


650	# Use after unRAID updates when containers can't reach each other on custom networks.
651	#
652	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh --status
653	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh --dry-run
654	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh
655
656	# docker_update.sh — pull latest images for daily restart containers, no downtime
657	# Called by daily_sync_maintenance.sh BEFORE docker_daily_restart.sh.
658	# Targets HOST*_DAILY_RESTART_CONTAINERS — same list as daily restart, no separate config.
659	# Containers stay running during the pull. docker_daily_restart.sh picks up the new image.
660	# Reports "updated" vs "already current" per container — useful to see what actually changed.
661	# Toggle: DAILY_CONTAINER_UPDATES=false in master.conf skips all pulls, restart still runs.
662	#
663	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
664	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
665	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh
666
667	# docker_update_remaining.sh — pull latest images for all containers not in daily/weekly lists
668	# Called by weekly_sync_maintenance.sh at the end of the Sunday window.
669	# Derives target set from `docker ps` minus DAILY_RESTART_CONTAINERS + WEEKLY_RESTART_CONTAINERS.
670	# Only running containers — stopped containers are excluded (likely paused intentionally).
671	# Together with docker_update.sh and the weekly image pull: every deployed container gets
672	# at least one image pull per week with no second list to maintain.
673	# Toggle: WEEKLY_REMAINING_UPDATES=false in master.conf skips all pulls.
674	#
675	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --dry-run
676	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --status
677	# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh
678
679	# downloaders_reset.sh — maintenance reset for all download clients on this server
680	# Called every 30 minutes by critical_sync_maintenance.sh via CRITICAL_MAINTENANCE_SCRIPTS.
681	# Host-aware: sections skip gracefully if a downloader URL is empty for this server.
682	#
683	# slskd:
684	#   Stuck searches    — clears Completed/Errored searches left by Soularr crashes
685	#   Dead transfers    — removes completed/errored/aborted transfer records per user
686	#                       NEVER removes InProgress or Queued transfers
687	#   Failed imports    — purges albums Soularr downloaded but Lidarr rejected
688	# SABnzbd:
689	#   Completed history — removes completed records older than DOWNLOADER_RETENTION_DAYS

# Use after unRAID updates when containers can't reach each other on custom networks.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh

# docker_update.sh — pull latest images for daily restart containers, no downtime
# Called by daily_sync_maintenance.sh BEFORE docker_daily_restart.sh.
# Targets HOST*_DAILY_RESTART_CONTAINERS — same list as daily restart, no separate config.
# Containers stay running during the pull. docker_daily_restart.sh picks up the new image.
# Reports "updated" vs "already current" per container — useful to see what actually changed.
# Toggle: DAILY_CONTAINER_UPDATES=false in master.conf skips all pulls, restart still runs.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh

# docker_update_remaining.sh — pull latest images for all containers not in daily/weekly lists
# Called by weekly_sync_maintenance.sh at the end of the Sunday window.
# Derives target set from `docker ps` minus DAILY_RESTART_CONTAINERS + WEEKLY_RESTART_CONTAINERS.
# Only running containers — stopped containers are excluded (likely paused intentionally).
# Together with docker_update.sh and the weekly image pull: every deployed container gets
# at least one image pull per week with no second list to maintain.
# Toggle: WEEKLY_REMAINING_UPDATES=false in master.conf skips all pulls.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh

# downloaders_reset.sh — maintenance reset for all download clients on this server
# Called every 30 minutes by critical_sync_maintenance.sh via CRITICAL_MAINTENANCE_SCRIPTS.
# Host-aware: sections skip gracefully if a downloader URL is empty for this server.
#
# slskd:
#   Stuck searches    — clears Completed/Errored searches left by Soularr crashes
#   Dead transfers    — removes completed/errored/aborted transfer records per user
#                       NEVER removes InProgress or Queued transfers
#   Failed imports    — purges albums Soularr downloaded but Lidarr rejected
# SABnzbd:
#   Completed history — removes completed records older than DOWNLOADER_RETENTION_DAYS


Edit

# docker_update.sh — pull latest images for daily restart containers, no downtime
# Called by daily_sync_maintenance.sh BEFORE docker_daily_restart.sh.
# Targets HOST*_DAILY_RESTART_CONTAINERS — same list as daily restart, no separate config.
# Containers stay running during the pull. docker_daily_restart.sh picks up the new image.
# Reports "updated" vs "already current" per container — useful to see what actually changed.
# Toggle: DAILY_CONTAINER_UPDATES=false in master.conf skips all pulls, restart still runs.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh

# docker_update_remaining.sh — pull latest images for all containers not in daily/weekly lists
# Called by weekly_sync_maintenance.sh at the end of the Sunday window.
# Derives target set from `docker ps` minus DAILY_RESTART_CONTAINERS + WEEKLY_RESTART_CONTAINERS.
# Only running containers — stopped containers are excluded (likely paused intentionally).
# Together with docker_update.sh and the weekly image pull: every deployed container gets
# at least one image pull per week with no second list to maintain.
# Toggle: WEEKLY_REMAINING_UPDATES=false in master.conf skips all pulls.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh

# docker_update.sh — pull latest images for managed containers, rebuild those that got a new digest
# Two modes, one script:
#
#   Normal (daily) — targets HOST*_DAILY_RESTART_CONTAINERS.
#     Containers stay running during the pull. Rebuilds containers that received a new image.
#     docker_daily_restart.sh restarts the rest. Toggle: DAILY_CONTAINER_UPDATES in master.conf.
#
#   Remainder (weekly) — targets all running containers not in managed lists.
#     Excludes daily list, weekly restart list, emby+critical-data sync-window containers,
#     and fallback containers owned by the remote server's update cycle.
#     Rebuilds containers that received a new image. Toggle: WEEKLY_REMAINING_UPDATES in master.conf.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --remainder
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --remainder --dry-run


The file /boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh has been updated successfully. (file state is current in your context — no need to Read it back)

# docker_update.sh — pull latest images for daily restart containers, no downtime
# Called by daily_sync_maintenance.sh BEFORE docker_daily_restart.sh.
# Targets HOST*_DAILY_RESTART_CONTAINERS — same list as daily restart, no separate config.
# Containers stay running during the pull. docker_daily_restart.sh picks up the new image.
# Reports "updated" vs "already current" per container — useful to see what actually changed.
# Toggle: DAILY_CONTAINER_UPDATES=false in master.conf skips all pulls, restart still runs.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh

# docker_update_remaining.sh — pull latest images for all containers not in daily/weekly lists
# Called by weekly_sync_maintenance.sh at the end of the Sunday window.
# Derives target set from `docker ps` minus DAILY_RESTART_CONTAINERS + WEEKLY_RESTART_CONTAINERS.
# Only running containers — stopped containers are excluded (likely paused intentionally).
# Together with docker_update.sh and the weekly image pull: every deployed container gets
# at least one image pull per week with no second list to maintain.
# Toggle: WEEKLY_REMAINING_UPDATES=false in master.conf skips all pulls.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh

# docker_update.sh — pull latest images for managed containers, rebuild those that got a new digest
# Two modes, one script:
#
#   Normal (daily) — targets HOST*_DAILY_RESTART_CONTAINERS.
#     Containers stay running during the pull. Rebuilds containers that received a new image.
#     docker_daily_restart.sh restarts the rest. Toggle: DAILY_CONTAINER_UPDATES in master.conf.
#
#   Remainder (weekly) — targets all running containers not in managed lists.
#     Excludes daily list, weekly restart list, emby+critical-data sync-window containers,
#     and fallback containers owned by the remote server's update cycle.
#     Rebuilds containers that received a new image. Toggle: WEEKLY_REMAINING_UPDATES in master.conf.
#
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --dry-run
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --status
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --remainder
# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --remainder --dry-run

# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_network_connect.sh --dry-run

-# docker_update.sh — pull latest images for daily restart containers, no downtime

-# Called by daily_sync_maintenance.sh BEFORE docker_daily_restart.sh.

-# Targets HOST*_DAILY_RESTART_CONTAINERS — same list as daily restart, no separate config.

-# Containers stay running during the pull. docker_daily_restart.sh picks up the new image.

-# Reports "updated" vs "already current" per container — useful to see what actually changed.

-# Toggle: DAILY_CONTAINER_UPDATES=false in master.conf skips all pulls, restart still runs.

+# docker_update.sh — pull latest images for managed containers, rebuild those that got a new digest

+#   Normal (daily) — targets HOST*_DAILY_RESTART_CONTAINERS.

+#     Containers stay running during the pull. Rebuilds containers that received a new image.

+#     docker_daily_restart.sh restarts the rest. Toggle: DAILY_CONTAINER_UPDATES in master.conf.

+#   Remainder (weekly) — targets all running containers not in managed lists.

+#     Excludes daily list, weekly restart list, emby+critical-data sync-window containers,

+#     and fallback containers owned by the remote server's update cycle.

+#     Rebuilds containers that received a new image. Toggle: WEEKLY_REMAINING_UPDATES in master.conf.

+# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh --remainder --dry-run

-# docker_update_remaining.sh — pull latest images for all containers not in daily/weekly lists

-# Called by weekly_sync_maintenance.sh at the end of the Sunday window.

-# Derives target set from `docker ps` minus DAILY_RESTART_CONTAINERS + WEEKLY_RESTART_CONTAINERS.

-# Only running containers — stopped containers are excluded (likely paused intentionally).

-# Together with docker_update.sh and the weekly image pull: every deployed container gets

-# at least one image pull per week with no second list to maintain.

-# Toggle: WEEKLY_REMAINING_UPDATES=false in master.conf skips all pulls.

-# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --dry-run

-# bash /boot/config/plugins/varaverk/Docker_Essentials/docker_update_remaining.sh --status

# downloaders_reset.sh — maintenance reset for all download clients on this server

# Called every 30 minutes by critical_sync_maintenance.sh via CRITICAL_MAINTENANCE_SCRIPTS.

# Host-aware: sections skip gracefully if a downloader URL is empty for this server.


Now fix the two comment references in user_script_plug-in.sh header:


70	#           individually below for standalone use. Inline descriptions on every entry.
71	#           Correct schedules verified against script headers. sunday_morning_coffee_report
72	#           and rsync_emby_fallback added as separate scheduled entries.
73	#   v2.3 — intermediate_sync_maintenance.sh new 4-hour orchestrator (arr_sync + artwork).
74	#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.
75	#           downloaders_reset.sh: slskd + SABnzbd + qBittorrent maintenance.
76	#           arr_sync.sh: bidirectional Lidarr/Sonarr/Radarr library mesh.
77	#           lidarr_missing_art.sh: fetch missing album/artist artwork.
78	#           radarr_tmdb_removed.sh + sonarr_tvdb_removed.sh: dropped-entry cleanup.
79	#           Initial_run/ section: ssh_setup.sh + partnership_onboard.sh.

#           individually below for standalone use. Inline descriptions on every entry.
#           Correct schedules verified against script headers. sunday_morning_coffee_report
#           and rsync_emby_fallback added as separate scheduled entries.
#   v2.3 — intermediate_sync_maintenance.sh new 4-hour orchestrator (arr_sync + artwork).
#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.
#           downloaders_reset.sh: slskd + SABnzbd + qBittorrent maintenance.
#           arr_sync.sh: bidirectional Lidarr/Sonarr/Radarr library mesh.
#           lidarr_missing_art.sh: fetch missing album/artist artwork.
#           radarr_tmdb_removed.sh + sonarr_tvdb_removed.sh: dropped-entry cleanup.
#           Initial_run/ section: ssh_setup.sh + partnership_onboard.sh.


docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.

docker_update.sh (normal + --remainder): daily/weekly image pulls.


<tool_use_error>String to replace not found in file.
String:                 docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.</tool_use_error>

Error: String to replace not found in file.
String:                 docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.


Bash

grep -n "docker_update_remaining" /boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh

Find remaining references to docker_update_remaining in user_script_plug-in.sh


74:#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.
333:#  10. docker_update_remaining.sh pull latest images for all containers not in daily/weekly lists


72	#           and rsync_emby_fallback added as separate scheduled entries.
73	#   v2.3 — intermediate_sync_maintenance.sh new 4-hour orchestrator (arr_sync + artwork).
74	#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.
75	#           downloaders_reset.sh: slskd + SABnzbd + qBittorrent maintenance.

#           and rsync_emby_fallback added as separate scheduled entries.
#   v2.3 — intermediate_sync_maintenance.sh new 4-hour orchestrator (arr_sync + artwork).
#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.
#           downloaders_reset.sh: slskd + SABnzbd + qBittorrent maintenance.


sed -n '74p' /boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh | cat -A | head -2

Show exact bytes on line 74 to check for special characters


#           docker_update.sh + docker_update_remaining.sh: daily/weekly image pulls.$


sed -i '74s/docker_update.sh + docker_update_remaining.sh: daily\/weekly image pulls./docker_update.sh (normal + --remainder): daily\/weekly image pulls./' /boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh && sed -i '333s/.*/# 10. docker_update.sh --remainder  pull latest images for all containers not in daily\/weekly lists/' /boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh

Fix remaining docker_update_remaining references in user_script_plug-in.sh


grep -n "docker_update_remaining" /boot/config/plugins/varaverk/Plugin/unraid/user_script_plug-in.sh

Verify no remaining references


Clean. Summary of what changed:

- **`docker_update_remaining.sh` deleted** — `docker_update.sh --remainder` now covers everything it did, with better exclusion logic (emby/critical-data, fallback containers) plus the `WEEKLY_REMAINING_UPDATES` toggle I just added to it
- **`docker_update.sh`** now handles both modes in one place:
  - No args = daily, targets `DAILY_RESTART_CONTAINERS`, respects `DAILY_CONTAINER_UPDATES`
  - `--remainder` = weekly sweep of everything else, respects `WEEKLY_REMAINING_UPDATES`
- All references in `user_script_plug-in.sh` updated


push it


cd /boot/config/plugins/varaverk && git status && git diff --stat

Show git status and diff summary


On branch main
Your branch is up to date with 'origin/main'.

You are in a sparse checkout with 100% of tracked files present.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   Docker_Essentials/docker_update.sh
	deleted:    Docker_Essentials/docker_update_remaining.sh
	modified:   Orchestrators/weekly_sync_maintenance.sh
	modified:   Partnership/partnership_onboard.sh
	modified:   Plugin/unraid/user_script_plug-in.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	claude-bin/
	claude-data/

no changes added to commit (use "git add" and/or "git commit -a")
 Docker_Essentials/docker_update.sh           |  16 +-
 Docker_Essentials/docker_update_remaining.sh | 325 ---------------------------
 Orchestrators/weekly_sync_maintenance.sh     |  44 +++-
 Partnership/partnership_onboard.sh           |  21 ++
 Plugin/unraid/user_script_plug-in.sh         |  35 ++-
 5 files changed, 92 insertions(+), 349 deletions(-)
Shell cwd was reset to /root


cd /boot/config/plugins/varaverk && git log --oneline -5

Check recent commit messages


ba3eed3 Sync READMEs and manuals to current script headers
420e13a Resolve bash variable references in vv_conf_vars()
181114a Header/code audit fixes across all core scripts
b4d6866 Polish before first GitHub push: consistent adapter usage and naming
ee5a07b Remove remaining OS-specific hardcodes from core scripts
Shell cwd was reset to /root


cd /boot/config/plugins/varaverk && git add Docker_Essentials/docker_update.sh Docker_Essentials/docker_update_remaining.sh Orchestrators/weekly_sync_maintenance.sh Partnership/partnership_onboard.sh Plugin/unraid/user_script_plug-in.sh && git commit -m "Fix container updates: rebuild on new image, consolidate update scripts

Weekly sync window was pulling images but using docker start after rsync,
which ignores the new digest. Containers in the emby/critical-data profiles
(Emby, Mariadb, Redis) never actually landed on updated images.

docker_update_remaining.sh merged into docker_update.sh --remainder, which
already had better exclusion logic. Added WEEKLY_REMAINING_UPDATES toggle
and WEEKLY_RESTART_CONTAINERS exclusion to remainder mode.

Onboard now runs docker_network_connect.sh on mirror before deploying stacks."

Stage and commit all changes


[main fdef61c] Fix container updates: rebuild on new image, consolidate update scripts
 5 files changed, 92 insertions(+), 349 deletions(-)
 delete mode 100755 Docker_Essentials/docker_update_remaining.sh
Shell cwd was reset to /root


cd /boot/config/plugins/varaverk && git push

Push to remote


remote: . Processing 1 references
remote: Processed 1 references in total
To ssh://192.168.50.2:221/FailedProxy/Varaverk.git
   ba3eed3..fdef61c  main -> main
Shell cwd was reset to /root


Pushed. One commit covering all of today's work.


docker_update.sh
#     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
#
# docker_update.sh --remainder
#     Remainder mode — pull all running containers not in managed lists,
#     restart those that received updates, prune dangling images
#
# docker_update.sh --dry-run
#     Preview which containers would be pulled without making changes
#
# docker_update.sh --status
#     Show configuration and container list for current mode
#
# docker_update.sh --log
#     Verbose per-container pull and comparison output, what does weekly use


The docblock doesn't say. Let me add caller context to both entries.


Edit

# docker_update.sh
#     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
#
# docker_update.sh --remainder
#     Remainder mode — pull all running containers not in managed lists,
#     restart those that received updates, prune dangling images
#
# docker_update.sh --dry-run
#     Preview which containers would be pulled without making changes
#
# docker_update.sh --status
#     Show configuration and container list for current mode
#
# docker_update.sh --log
#     Verbose per-container pull and comparison output

# docker_update.sh
#     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
#     Called by daily_sync_maintenance.sh before docker_daily_restart.sh
#
# docker_update.sh --remainder
#     Remainder mode — pull all running containers not in managed lists,
#     restart those that received updates, prune dangling images
#     Called by weekly_sync_maintenance.sh at the end of the Sunday window
#
# docker_update.sh --dry-run
#     Preview which containers would be pulled without making changes
#
# docker_update.sh --status
#     Show configuration and container list for current mode
#
# docker_update.sh --log
#     Verbose per-container pull and comparison output


# docker_update.sh
#     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
#
# docker_update.sh --remainder
#     Remainder mode — pull all running containers not in managed lists,
#     restart those that received updates, prune dangling images
#
# docker_update.sh --dry-run
#     Preview which containers would be pulled without making changes
#
# docker_update.sh --status
#     Show configuration and container list for current mode
#
# docker_update.sh --log
#     Verbose per-container pull and comparison output

# docker_update.sh
#     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
#     Called by daily_sync_maintenance.sh before docker_daily_restart.sh
#
# docker_update.sh --remainder
#     Remainder mode — pull all running containers not in managed lists,
#     restart those that received updates, prune dangling images
#     Called by weekly_sync_maintenance.sh at the end of the Sunday window
#
# docker_update.sh --dry-run
#     Preview which containers would be pulled without making changes
#
# docker_update.sh --status
#     Show configuration and container list for current mode
#
# docker_update.sh --log
#     Verbose per-container pull and comparison output

+#     Called by daily_sync_maintenance.sh before docker_daily_restart.sh

+#     Called by weekly_sync_maintenance.sh at the end of the Sunday window


docker_update.sh #     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS # # docker_update.sh --remainder #     Remainder mode — pull all running containers not in managed lists, #     res…


Bash

cd /boot/config/plugins/varaverk && git add Docker_Essentials/docker_update.sh && git commit -m "Document which orchestrator calls each docker_update.sh mode" && git push

Commit and push docblock update


[main a5292c4] Document which orchestrator calls each docker_update.sh mode
 1 file changed, 2 insertions(+)
remote: . Processing 1 references
remote: Processed 1 references in total
To ssh://192.168.50.2:221/FailedProxy/Varaverk.git
   fdef61c..a5292c4  main -> main
Shell cwd was reset to /root


Done. Both modes now document their caller in the runtime modes section.


ok, now doesnt remainder catch one specifically not in daily or weekly?


Yes — `WEEKLY_RESTART_CONTAINERS` (NextCloud, AdGuard, Immich, Organizrr). I excluded them from remainder but that was wrong. `docker_weekly_restart.sh` only restarts them, it doesn't pull new images. Remainder is exactly where their image updates should happen.


Edit

    # Weekly restart containers — restarted by docker_weekly_restart.sh after sync
    for _c in "${WEEKLY_RESTART_CONTAINERS[@]}"; do
        [[ -n "$_c" ]] && _exclude["$_c"]=1
    done

    # Fallback coverage containers — owned by the remote server's update cycle.

# Fallback coverage containers — owned by the remote server's update cycle.


The file /boot/config/plugins/varaverk/Docker_Essentials/docker_update.sh has been updated successfully. (file state is current in your context — no need to Read it back)

    # Weekly restart containers — restarted by docker_weekly_restart.sh after sync
    for _c in "${WEEKLY_RESTART_CONTAINERS[@]}"; do
        [[ -n "$_c" ]] && _exclude["$_c"]=1
    done

    # Fallback coverage containers — owned by the remote server's update cycle.

-    # Weekly restart containers — restarted by docker_weekly_restart.sh after sync

-    for _c in "${WEEKLY_RESTART_CONTAINERS[@]}"; do

# This server runs them during fallback but should never update them independently.

# Updating them here risks version divergence: if remote's writeback after handback


Conversation compacted


This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.

Summary:
1. Primary Request and Intent:

   Three tasks were completed this session:

   a) **Onboard network setup**: Run `docker_network_connect.sh` on the mirror before container deployment during partnership onboard, so the custom Docker network exists before `docker create --network=` is called.

   b) **Fix container updates not working**: Daily and weekly ran but reported no containers updated, despite Unraid showing ~half the containers need updates on a 5-6 year old system. Root cause: the weekly sync window pulled new images for `MAINTENANCE_CONTAINERS` (Emby, Mariadb-Authelia, Redis-Authelia, etc.) but restarted them with `docker start`, which re-uses the image SHA baked at container creation time — containers never actually ran the new image. Also, `docker_update_remaining.sh` in `WEEKLY_MAINTENANCE_SCRIPTS` was running before the hardcoded `docker_update.sh --remainder` in weekly, consuming all updates and leaving nothing for the second pass.

   c) **Consolidate two update scripts into one**: `docker_update_remaining.sh` was made redundant by `docker_update.sh --remainder` (which already covered everything with better exclusion logic). Delete it, add the missing `WEEKLY_REMAINING_UPDATES` toggle to `--remainder` mode, and clean up all references.

2. Key Technical Concepts:
   - Varaverk: self-healing two-server Unraid home media ecosystem; one codebase runs on both servers
   - Three-file config model: `master.conf` (shared thresholds/toggles), `host1.conf`, `host2.conf` (per-host credentials/container names)
   - `detect_hosts()` in `common.sh` matches hostname, sets `MY_ID`/`REMOTE_ID`, aliases `HOST*_` vars to generic names
   - `platform_rebuild_container()` in `Plugin/unraid/adapter.sh` — calls Unraid's `/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/rebuild_container` PHP script, which recreates a container from its XML template (stops old, creates new with new image digest, starts it)
   - `docker start` vs `platform_rebuild_container`: `docker start` re-uses the image SHA baked at container creation time; only `platform_rebuild_container` picks up a newly pulled image
   - `acquire_lock()` in `common.sh` uses per-script-name lock files (`$LOCK_DIR/<scriptname>.lock`), not a global lock — no deadlock between orchestrator and child scripts
   - Partnership onboard: Mirror path (SSH key setup) then Owner path (deploy auth/arr/services stacks on mirror via XML templates)
   - `deploy_container_from_xml()` uses `--network=` flag from XML, requiring the custom network to exist on the mirror before deployment
   - `DAILY_RESTART_CONTAINERS` (host*.conf): containers updated daily and restarted nightly
   - `WEEKLY_RESTART_CONTAINERS` (host*.conf): containers restarted weekly after sync
   - `MAINTENANCE_CONTAINERS` (derived from `PROFILE_CRITICAL_CONTAINER_NAMES[emby]` + `[critical-data]`): stopped for weekly rsync window, updated via `WEEKLY_SYNC_UPDATES`
   - Remainder mode exclusion list: `DAILY_RESTART_CONTAINERS` + emby/critical-data profiles + `WEEKLY_RESTART_CONTAINERS` (newly added) + fallback containers owned by remote server

3. Files and Code Sections:

   - **`Partnership/partnership_onboard.sh`**
     - Added `STEP_NETWORK_OK=false` to tracking vars block
     - Added "Step 1b — Docker Network (Mirror)" section between Phase 1 exit and Step 2 (stop auth stack)
     - Added `Step 1b — Docker network:` line to summary output
     ```bash
     STEP_NETWORK_OK=false
     ...
     _net_script="${SCRIPTS_ROOT}/Docker_Essentials/docker_network_connect.sh"
     if [[ "$DRY_RUN" == true ]]; then
         warn "DRY RUN — would run docker_network_connect.sh on $MIRROR"
         STEP_NETWORK_OK=true
     elif timeout 60 ssh -i "$MIRROR_SSH_KEY" \
             -o ConnectTimeout="$SSH_TIMEOUT" -o BatchMode=yes root@"$MIRROR_IP" \
             "bash '$_net_script'" 2>/dev/null; then
         log "Docker network ready on $MIRROR ✅"
         STEP_NETWORK_OK=true
     else
         warn "docker_network_connect.sh failed on $MIRROR — containers may fail if network is missing"
         warn "Check ${_net_script} on $MIRROR and re-run with --skip-ssh if needed"
     fi
     ```

   - **`Configurations/master.conf`**
     - Removed `"Docker_Essentials/docker_update_remaining.sh"` from `WEEKLY_MAINTENANCE_SCRIPTS`
     - `WEEKLY_MAINTENANCE_SCRIPTS` now contains: `docker_weekly_restart.sh`, `clear_logs.sh`, three playback_aware discovery scripts

   - **`Docker_Essentials/docker_update.sh`**
     - Added `WEEKLY_REMAINING_UPDATES` check at top of remainder mode container discovery
     - Added `WEEKLY_RESTART_CONTAINERS` to the exclusion set in remainder mode
     - Added `WEEKLY_REMAINING_UPDATES` to CONFIGURATION docblock
     - Updated RUNTIME MODES section to document which orchestrator calls each mode
     - Updated status output string for remainder mode
     ```bash
     if [[ "$REMAINDER_MODE" == true ]]; then
         if [[ "${WEEKLY_REMAINING_UPDATES:-true}" != "true" ]]; then
             echo "WEEKLY_REMAINING_UPDATES=false — skipping remainder container updates"
             exit 0
         fi
         declare -A _exclude=()
         # Daily containers
         for _c in "${DAILY_RESTART_CONTAINERS[@]}"; do [[ -n "$_c" ]] && _exclude["$_c"]=1; done
         # Weekly sync-window containers (emby + critical-data)
         _weekly_str="${PROFILE_CRITICAL_CONTAINER_NAMES[emby]:-} ${PROFILE_CRITICAL_CONTAINER_NAMES[critical-data]:-}"
         read -r -a _weekly_arr <<< "$_weekly_str"
         for _c in "${_weekly_arr[@]}"; do [[ -n "$_c" ]] && _exclude["$_c"]=1; done
         # Weekly restart containers — restarted by docker_weekly_restart.sh after sync
         for _c in "${WEEKLY_RESTART_CONTAINERS[@]}"; do [[ -n "$_c" ]] && _exclude["$_c"]=1; done
         # Fallback coverage containers
         for _tier in 1 2 3 4; do ... done
     ```
     Runtime modes now read:
     ```
     # docker_update.sh
     #     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
     #     Called by daily_sync_maintenance.sh before docker_daily_restart.sh
     #
     # docker_update.sh --remainder
     #     Remainder mode — pull all running containers not in managed lists,
     #     restart those that received updates, prune dangling images
     #     Called by weekly_sync_maintenance.sh at the end of the Sunday window
     ```

   - **`Docker_Essentials/docker_update_remaining.sh`** — DELETED. Was a standalone script that duplicated `docker_update.sh --remainder` with weaker exclusion logic (missed emby/critical-data and fallback containers, didn't check `WEEKLY_REMAINING_UPDATES` toggle).

   - **`Orchestrators/weekly_sync_maintenance.sh`**
     - Added `declare -A _weekly_needs_rebuild=()` before the `WEEKLY_SYNC_UPDATES` block
     - In the local pull loop: capture `_old_id` before pull, `_new_id` after, mark container for rebuild if digest changed
     - Replaced `start_local_containers` call with rebuild-aware inline loop
     ```bash
     declare -A _weekly_needs_rebuild=()
     # In pull loop:
     _old_id=$(docker image inspect "$IMAGE" --format='{{.Id}}' 2>/dev/null || echo "")
     if docker pull "$IMAGE" >/dev/null 2>&1; then
         _new_id=$(docker image inspect "$IMAGE" --format='{{.Id}}' 2>/dev/null || echo "")
         if [[ -n "$_old_id" && "$_old_id" != "$_new_id" ]]; then
             log "$c — new image (${_old_id:7:12} → ${_new_id:7:12}) — will rebuild after sync"
             _weekly_needs_rebuild["$c"]=1
         else
             log "$c — already current"
         fi
     fi
     # Start phase replaces start_local_containers:
     for _c in "${LOCAL_RUNNING_CONTAINERS[@]}"; do
         [[ -z "$_c" ]] && continue
         _needs_delay=false
         for _d in "${DELAYED_CONTAINERS[@]}"; do
             [[ "$_c" == "$_d" ]] && _needs_delay=true && break
         done
         [[ "$_needs_delay" == true ]] && { info "Waiting ${CONTAINER_DELAY}s..."; sleep "$CONTAINER_DELAY"; }
         if [[ -n "${_weekly_needs_rebuild[$_c]:-}" ]]; then
             if platform_rebuild_container "$_c"; then
                 log "$_c rebuilt on new image ✅"
             else
                 warn "$_c rebuild failed — falling back to docker start"
                 docker start "$_c" >/dev/null 2>&1 || error "Failed to start $_c"
             fi
         else
             docker start "$_c" >/dev/null 2>&1 && log "$_c started" || error "Failed to start $_c"
         fi
     done
     ```

   - **`Plugin/unraid/user_script_plug-in.sh`**
     - Replaced `docker_update_remaining.sh` entry with combined `docker_update.sh` entry documenting both normal and remainder modes
     - Updated v2.3 changelog line from `docker_update.sh + docker_update_remaining.sh` to `docker_update.sh (normal + --remainder)`
     - Updated step 10 comment from `docker_update_remaining.sh` to `docker_update.sh --remainder`

4. Errors and fixes:
   - **`sed` Edit tool failure on user_script_plug-in.sh line 74**: The Edit tool failed to match the string due to leading tabs/spaces. Fixed by using `sed -i` directly via Bash tool on the specific line numbers.
   - **Container updates not working despite scripts running**: Root cause was `docker start` ignoring newly pulled images (uses creation-time SHA). Fixed by adding digest tracking and `platform_rebuild_container` for changed images in weekly sync window.
   - **Duplicate remainder update work**: `docker_update_remaining.sh` in `WEEKLY_MAINTENANCE_SCRIPTS` ran first and consumed all available updates before `docker_update.sh --remainder` ran. Fixed by removing it from the list (and then deleting the file entirely).

5. Problem Solving:
   - **Weekly sync window not updating containers**: Emby, Mariadb-Authelia, Mariadb-Authelia-Secondary, Redis-Authelia, Redis-Authelia-Secondary were having images pulled every week but never actually running the new image. `docker start` ignores pulled images — only `platform_rebuild_container` (which recreates from XML template) picks up new digests. Fixed in weekly_sync_maintenance.sh.
   - **Script consolidation**: `docker_update_remaining.sh` was fully absorbed into `docker_update.sh --remainder` with all missing features added (WEEKLY_REMAINING_UPDATES toggle, WEEKLY_RESTART_CONTAINERS exclusion). Old script deleted.

6. All user messages:
   - "during onboard we need to run the docker network script to ensure the custom network is there before containers get installed"
   - "ok now daily and weekly ran. no containers were updated"
   - "no half the containers need updates and were not touched, this system has been running unraid for 5 or 6 years"
   - "so we have 2 update scripts do we need both or can we condense down to one, maybe with a extra arg or 2"
   - [Pasted docker_update.sh RUNTIME MODES section] "what does weekly use"
   - "push it"
   - "ok, now doesnt remainder catch one specifically not in daily or weekly?" [followed immediately by summarization request]

7. Pending Tasks:
   - Answer the user's question: "doesnt remainder catch one specifically not in daily or weekly?" — The user is asking for confirmation/clarification that `--remainder` mode is specifically designed to catch the containers that are NOT in either `DAILY_RESTART_CONTAINERS` OR `WEEKLY_RESTART_CONTAINERS` (nor in the weekly sync window managed lists). This is correct — that is exactly what remainder mode does.

8. Current Work:
   The user asked: "ok, now doesnt remainder catch one specifically not in daily or weekly?" immediately before the summarization request. This was a conceptual question about `docker_update.sh --remainder`'s purpose — confirming that it targets exactly the containers not covered by daily (`DAILY_RESTART_CONTAINERS`) or weekly managed lists (`WEEKLY_RESTART_CONTAINERS` + emby/critical-data sync-window containers + fallback containers).

   All code changes from this session were committed and pushed:
   - Commit `fdef61c`: "Fix container updates: rebuild on new image, consolidate update scripts"
   - Commit `a5292c4`: "Document which orchestrator calls each docker_update.sh mode"
   - Remote: `ssh://192.168.50.2:221/FailedProxy/Varaverk.git` branch `main`

9. Optional Next Step:
   Answer the user's pending question: "ok, now doesnt remainder catch one specifically not in daily or weekly?" — confirm that yes, `--remainder` mode is explicitly designed to catch the gap: running containers that are not in `DAILY_RESTART_CONTAINERS`, not in `WEEKLY_RESTART_CONTAINERS`, not in the weekly sync-window managed containers (emby/critical-data profiles), and not fallback containers owned by the remote server's update cycle. Those four exclusions define the "managed lists" and everything outside them is the "remainder."

If you need specific details from before compaction (like exact code snippets, error messages, or content you generated), read the full transcript at: /root/.claude/projects/-root/faa6d093-11ef-4bd4-9a9a-e0495100f066.jsonl
Continue the conversation from where it left off without asking the user any further questions. Resume directly — do not acknowledge the summary, do not recap what was happening, do not preface with "I'll continue" or similar. Pick up the last task as if the break never happened.


#!/bin/bash
# ==============================================================================================
# ================================= Docker Update ==============================================
# ==============================================================================================
#
# PURPOSE
# ─────────────────────────────────────────────────────────────────────────────
# Pulls the latest images for configured containers. Two modes: normal (daily)
# and remainder (weekly).
#
# Normal mode is called by daily_sync_maintenance.sh before docker_daily_restart.sh.
# Containers stay running during the pull — no extra downtime beyond what the
# nightly restart already causes.
#
# Remainder mode is called by weekly_sync_maintenance.sh as the final update step.
# It catches everything that normal mode and the weekly sync window did not already
# update — derived automatically from docker ps, nothing to configure.
#
# ==============================================================================================
# OPERATIONAL MODEL
# ==============================================================================================
#
# Normal mode (daily):
#   Targets DAILY_RESTART_CONTAINERS — same list used by docker_daily_restart.sh.
#   Pull → compare old vs new image ID → mark updated or already current.
#   docker_daily_restart.sh runs after — containers restart onto the fresh image.
#
# Remainder mode (weekly):
#   Targets all currently running containers NOT in:
#     DAILY_RESTART_CONTAINERS       — already updated daily
#     emby + critical-data profiles  — updated inline by the weekly sync window
#     WEEKLY_RESTART_CONTAINERS      — restarted by docker_weekly_restart.sh after sync
#     FALLBACK_*_TIER*               — owned by the remote server's update cycle
#   Pull → compare → prune dangling images.
#
# ==============================================================================================
# DESIGN PRINCIPLES
# ==============================================================================================
#
# Single List
#   Normal mode reuses DAILY_RESTART_CONTAINERS rather than maintaining a
#   separate update list. Adding or removing a container from the restart list
#   automatically updates the image pull list — one change, both places.
#
# Version Ownership
#   Fallback containers are excluded from remainder mode. This server only runs
#   them during a fallback. The remote server owns their version — if remainder
#   updates them independently and a handback occurs, the remote's older image
#   may not handle data written by the newer version.
#
# State Respect
#   Stopped containers are never targeted. Pulling while stopped adds no value
#   and a stopped container was likely halted intentionally.
#
# ==============================================================================================
# OPERATIONAL SAFEGUARDS
# ==============================================================================================
#
# Lock Acquisition
#   Prevents concurrent execution via acquire_lock(). Safe to call from
#   maintenance scripts without risk of overlap.
#
# Host Detection
#   detect_hosts() identifies which server is running the script and aliases
#   HOST*_DAILY_RESTART_CONTAINERS to the correct host's values.
#
# Root Enforcement
#   Docker operations require root privileges.
#
# DAILY_CONTAINER_UPDATES Toggle
#   Normal mode exits cleanly when disabled. docker_daily_restart.sh still runs
#   regardless — update and restart are independent operations.
#
# Fallback Exclusion
#   Remainder mode excludes containers owned by the remote server's update cycle
#   to prevent version divergence across the fallback boundary.
#
# Running-Only Filter
#   Stopped containers excluded from remainder mode — intentionally down.
#
# Image ID Comparison
#   Containers not restarted unless their image actually changed. Pulls that
#   result in "already up to date" produce no restart.
#
# ==============================================================================================
# CONFIGURATION
# ==============================================================================================
#
# master.conf
#
#   DAILY_CONTAINER_UPDATES
#       Enable or disable normal mode. docker_daily_restart.sh runs regardless.
#       (default: true)
#
#   WEEKLY_REMAINING_UPDATES
#       Enable or disable remainder mode. (default: true)
#
#   PROFILE_CRITICAL_CONTAINER_NAMES[emby|critical-data]
#       Container names for emby and critical-data profiles — excluded from
#       remainder mode (already updated by the weekly sync window)
#
# host*.conf
#
#   HOST*_DAILY_RESTART_CONTAINERS
#       Containers updated in normal mode. Aliased by detect_hosts() →
#       DAILY_RESTART_CONTAINERS
#
# ==============================================================================================
# RUNTIME MODES
# ==============================================================================================
#
# docker_update.sh
#     Normal mode — pull latest images for DAILY_RESTART_CONTAINERS
#     Called by daily_sync_maintenance.sh before docker_daily_restart.sh
#
# docker_update.sh --remainder
#     Remainder mode — pull all running containers not in managed lists,
#     restart those that received updates, prune dangling images
#     Called by weekly_sync_maintenance.sh at the end of the Sunday window
#
# docker_update.sh --dry-run
#     Preview which containers would be pulled without making changes
#
# docker_update.sh --status
#     Show configuration and container list for current mode
#
# docker_update.sh --log
#     Verbose per-container pull and comparison output
#
# ==============================================================================================

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "$SCRIPT_DIR/../load_config.sh"

# Pre-parse --remainder before parse_args (unknown args pass through to PARSED_ARGS)
REMAINDER_MODE=false
_filtered_args=()
for _arg in "$@"; do
    if [[ "$_arg" == "--remainder" ]]; then
        REMAINDER_MODE=true
    else
        _filtered_args+=("$_arg")
    fi
done
unset _arg

parse_args "${_filtered_args[@]}"
unset _filtered_args

# ==============================================================================================
# ━━━ Setup ━━━
# ==============================================================================================
if [[ "$EUID" -ne 0 ]]; then
    error "Must be run as root"
    exit 1
fi

acquire_lock

if ! command -v docker &>/dev/null; then
    error "Docker command not found"
    exit 1
fi

detect_hosts

# ==============================================================================================
# ━━━ Container Discovery ━━━
# ==============================================================================================
if [[ "$REMAINDER_MODE" == true ]]; then
    if [[ "${WEEKLY_REMAINING_UPDATES:-true}" != "true" ]]; then
        echo "WEEKLY_REMAINING_UPDATES=false — skipping remainder container updates"
        exit 0
    fi

    declare -A _exclude=()

    # Daily containers — updated by docker_update.sh normal mode
    for _c in "${DAILY_RESTART_CONTAINERS[@]}"; do
        [[ -n "$_c" ]] && _exclude["$_c"]=1
    done

    # Weekly sync-window containers (emby + critical-data) — updated inline by weekly_sync_maintenance.sh
    _weekly_str="${PROFILE_CRITICAL_CONTAINER_NAMES[emby]:-} ${PROFILE_CRITICAL_CONTAINER_NAMES[critical-data]:-}"
    read -r -a _weekly_arr <<< "$_weekly_str"
    for _c in "${_weekly_arr[@]}"; do
        [[ -n "$_c" ]] && _exclude["$_c"]=1
    done
    unset _weekly_str _weekly_arr

    # Fallback coverage containers — owned by the remote server's update cycle.
    # This server runs them during fallback but should never update them independently.
    # Updating them here risks version divergence: if remote's writeback after handback
    # encounters data written by a newer version, it may not handle it correctly.
    for _tier in 1 2 3 4; do
        _tier_var="FALLBACK_${MY_ID}_COVERS_${REMOTE_ID}_TIER${_tier}"
        eval "_tier_arr=(\"\${${_tier_var}[@]:-}\")" 2>/dev/null
        for _c in "${_tier_arr[@]}"; do
            [[ -n "$_c" ]] && _exclude["$_c"]=1
        done
    done
    unset _tier _tier_var _tier_arr _c

    mapfile -t _all_running < <(docker ps --format '{{.Names}}' | sort)
    TARGET_CONTAINERS=()
    for _c in "${_all_running[@]}"; do
        [[ -z "${_exclude[$_c]+x}" ]] && TARGET_CONTAINERS+=("$_c")
    done
    unset _all_running _exclude _c
else
    if [[ "${DAILY_CONTAINER_UPDATES:-true}" != "true" ]]; then
        echo "DAILY_CONTAINER_UPDATES=false — skipping container updates"
        exit 0
    fi

    if [[ ${#DAILY_RESTART_CONTAINERS[@]} -eq 0 ]]; then
        warn "DAILY_RESTART_CONTAINERS is empty for $MY_ID — nothing to update"
        warn "Check HOST${MY_ID#HOST}_DAILY_RESTART_CONTAINERS in host*.conf"
        exit 0
    fi

    TARGET_CONTAINERS=("${DAILY_RESTART_CONTAINERS[@]}")
fi

# ==============================================================================================
# ━━━ Status ━━━
# ==============================================================================================
if [[ "$SHOW_STATUS" == true ]]; then
    echo ""
    echo "━━━━━ $ICON_SUMMARY STATUS ━━━━━"
    echo "$ICON_HOST       Identity:   $MY_ID ($LOCAL_SERVER_NAME)"
    echo "$ICON_GEAR       Mode:       $([[ "$REMAINDER_MODE" == true ]] && echo "remainder" || echo "normal (daily)")"
    if [[ "$REMAINDER_MODE" == true ]]; then
        echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, weekly restart, and fallback)"
        for _c in "${TARGET_CONTAINERS[@]}"; do echo "  $_c"; done
    else
        echo "$ICON_CONTAINERS Containers: ${TARGET_CONTAINERS[*]}"
        echo "$ICON_GEAR       Enabled:    ${DAILY_CONTAINER_UPDATES:-true}"
    fi
    echo "$ICON_GEAR       Dry Run:    $DRY_RUN"
    echo "━━━━━━━━━━━━━━━━━━━━━━━"
    exit 0
fi

[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no images will be pulled"

if [[ ${#TARGET_CONTAINERS[@]} -eq 0 ]]; then
    echo "No containers to update"
    exit 0
fi

# ==============================================================================================
# ━━━ Pull Updates ━━━
# ==============================================================================================
echo ""
if [[ "$REMAINDER_MODE" == true ]]; then
    echo "━━━ $ICON_CONTAINERS Docker Update (remainder) — $(date '+%Y-%m-%d %H:%M:%S') ━━━"
    echo "$ICON_CONTAINERS Updating ${#TARGET_CONTAINERS[@]} container(s) (not in daily or weekly sync)"
    log "$ICON_CONTAINERS Remainder targets: ${TARGET_CONTAINERS[*]}"
else
    echo "━━━ $ICON_CONTAINERS Docker Update — $(date '+%Y-%m-%d %H:%M:%S') ━━━"
    log "$ICON_CONTAINERS Containers: ${TARGET_CONTAINERS[*]}"
fi
echo ""

START=$(date +%s)
UPDATED=()
UP_TO_DATE=()
FAILED=()
OLD_IMAGE_IDS=()   # old image IDs to explicitly remove after rebuilds
SKIPPED=()

for container in "${TARGET_CONTAINERS[@]}"; do
    [[ -z "$container" ]] && continue
    log "━━━ $ICON_CONTAINERS $container ━━━"

    if ! docker inspect "$container" &>/dev/null; then
        warn "$container — not found, skipping"
        SKIPPED+=("$container")
        continue
    fi

    IMAGE=$(docker inspect --format='{{.Config.Image}}' "$container" 2>/dev/null)
    if [[ -z "$IMAGE" ]]; then
        warn "$container — could not determine image, skipping"
        SKIPPED+=("$container")
        continue
    fi

    log "$container — image: $IMAGE"

    if [[ "$DRY_RUN" == true ]]; then
        warn "DRY RUN — would pull: $IMAGE"
        UPDATED+=("$container")
        continue
    fi

    # Capture the image ID the container is currently running on, and the
    # image ID :latest points to before the pull. After pulling, we rebuild if
    # either a new digest landed OR the container is behind what :latest is now.
    CONTAINER_IMAGE_ID=$(docker inspect "$container" --format='{{.Image}}' 2>/dev/null || echo "")
    OLD_ID=$(docker image inspect "$IMAGE" --format='{{.Id}}' 2>/dev/null || echo "")

    log "$ICON_SYNC  Pulling $IMAGE..."
    if [[ "$ENABLE_LOGGING" == "true" ]]; then
        docker pull "$IMAGE" 2>&1 | grep -E "^(Status:|Digest:|Error|error)" | sed 's/^/  /'
        _pull_rc=${PIPESTATUS[0]}
    else
        docker pull "$IMAGE" >/dev/null 2>&1
        _pull_rc=$?
    fi
    NEW_ID=$(docker image inspect "$IMAGE" --format='{{.Id}}' 2>/dev/null || echo "")

    if [[ $_pull_rc -eq 0 ]]; then
        _pull_new=$(  [[ -n "$OLD_ID" && "$OLD_ID" != "$NEW_ID" ]] && echo true || echo false)
        _container_behind=$([[ -n "$CONTAINER_IMAGE_ID" && -n "$NEW_ID" && "$CONTAINER_IMAGE_ID" != "$NEW_ID" ]] && echo true || echo false)

        if [[ "$_pull_new" == true || "$_container_behind" == true ]]; then
            [[ "$_pull_new" == true ]]       && log "$ICON_DONE  $container — new image (${OLD_ID:7:12} → ${NEW_ID:7:12})"
            [[ "$_container_behind" == true && "$_pull_new" == false ]] && log "$ICON_DONE  $container — image already pulled, container behind (${CONTAINER_IMAGE_ID:7:12} → ${NEW_ID:7:12})"
            UPDATED+=("$container")
            OLD_IMAGE_IDS+=("$CONTAINER_IMAGE_ID")
        else
            log "$container — up to date (${NEW_ID:7:12})"
            UP_TO_DATE+=("$container")
        fi
    else
        warn "$container — pull failed ($IMAGE)"
        FAILED+=("$container")
    fi

done

# ── Recreate containers that received a new image ────────────────────────────
# docker restart uses the image ID baked in at creation time — it never picks
# up the new digest. rebuild_container reads the stored XML template, stops the
# old container, recreates it (new image, same config), then prunes the old image.
REBUILT=()
REBUILD_FAILED=()
if [[ ${#UPDATED[@]} -gt 0 ]]; then
    for container in "${UPDATED[@]}"; do
        [[ -z "$container" ]] && continue
        if [[ "$DRY_RUN" == true ]]; then
            warn "DRY RUN — would rebuild $container from template"
            REBUILT+=("$container")
            continue
        fi
        log "$ICON_SYNC Rebuilding $container from template on new image..."
        if platform_rebuild_container "$container"; then
            log "$ICON_DONE $container rebuilt ✅"
            REBUILT+=("$container")
        else
            error "Failed to rebuild $container — will be picked up by docker_daily_restart.sh"
            notify "$container failed to rebuild after image update on $(hostname)" "Docker Update" "warning"
            REBUILD_FAILED+=("$container")
        fi
    done
fi

# ── Remove old images ────────────────────────────────────────────────────────
# Explicitly rmi by the IDs captured before each pull. Tagged images are never
# caught by dangling-only prune, so this is the only reliable cleanup path.
# Fall through to dangling prune to catch any leftovers from other update paths.
if [[ "$DRY_RUN" == true ]]; then
    warn "DRY RUN — would remove ${#OLD_IMAGE_IDS[@]} old image(s) and prune dangling"
    PRUNED_SUMMARY="(dry run)"
else
    for _old_id in "${OLD_IMAGE_IDS[@]}"; do
        docker rmi "$_old_id" >/dev/null 2>&1 || true
    done
    PRUNED_OUTPUT=$(docker image prune -f 2>&1)
    [[ "$ENABLE_LOGGING" == "true" ]] && echo "$PRUNED_OUTPUT" | sed 's/^/  /'
    PRUNED_SUMMARY=$(echo "$PRUNED_OUTPUT" | grep -E "^Total reclaimed" || echo "nothing reclaimed")
fi

END=$(date +%s)

# ==============================================================================================
# ━━━ Summary ━━━
# ==============================================================================================
if [[ "$REMAINDER_MODE" == true ]]; then
    echo "━━━━━ $ICON_SUMMARY DOCKER UPDATE (REMAINDER) SUMMARY ━━━━━"
else
    echo "━━━━━ $ICON_SUMMARY DOCKER UPDATE SUMMARY ━━━━━"
fi
echo "$ICON_HOST       Identity:    $MY_ID ($LOCAL_SERVER_NAME)"
echo "$ICON_TIME       Duration:    $(format_duration $(( END - START )))"
if [[ ${#UPDATED[@]} -gt 0 ]]; then
    echo "$ICON_DONE       Updated:     ${#UPDATED[@]}"
    log "  ${UPDATED[*]}"
fi
[[ ${#REBUILT[@]} -gt 0 ]]       && echo "$ICON_SYNC       Rebuilt:     ${#REBUILT[@]}"
[[ ${#REBUILD_FAILED[@]} -gt 0 ]] && echo "$ICON_ERROR      Rebuild fail:${REBUILD_FAILED[*]}"
[[ ${#UP_TO_DATE[@]} -gt 0 ]]    && log "$ICON_RUNNING    Up to date:  ${UP_TO_DATE[*]}"
[[ ${#SKIPPED[@]} -gt 0 ]]       && log "$ICON_WARN       Skipped:     ${SKIPPED[*]}"
[[ ${#FAILED[@]} -gt 0 ]]        && echo "$ICON_ERROR      Failed:      ${FAILED[*]}"
echo "$ICON_SYNC       Pruned:      ${PRUNED_SUMMARY:-none}"

if [[ "$DRY_RUN" == true ]]; then
    warn "DRY RUN — no images pulled"
elif [[ ${#FAILED[@]} -eq 0 ]]; then
    echo "$ICON_DONE Status: done ✅ — ${#UPDATED[@]} updated, ${#UP_TO_DATE[@]} current"
else
    warn "Status: ${#FAILED[@]} pull(s) failed — restart will proceed with existing images"
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

# Pull failures are non-fatal — restart proceeds regardless
exit 0


claude claude-code-guide Explore general-purpose Plan statusline-setup

- claude: Catch-all for any task that doesn't fit a more specific agent. FleetView's default when no agent name is typed. (Tools: *)

- claude-code-guide: Use this agent when the user asks questions ("Can Claude...", "Does Claude...", "How do I...") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can continue via SendMessage. (Tools: Bash, Read, WebFetch, WebSearch)

- Explore: Fast read-only search agent for locating code. Use it to find files by pattern (eg. "src/components/**/*.tsx"), grep for symbols or keywords (eg. "API endpoints"), or answer "where is X defined / which files reference Y." Do NOT use it for code review, design-doc auditing, cross-file consistency checks, or open-ended analysis — it reads excerpts rather than whole files and will miss content past its read window. When calling, specify search breadth: "quick" for a single targeted lookup, "medium" for moderate exploration, or "very thorough" to search across multiple locations and naming conventions. (Tools: All tools except Agent, ExitPlanMode, Edit, Write, NotebookEdit)

- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)

- Plan: Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs. (Tools: All tools except Agent, ExitPlanMode, Edit, Write, NotebookEdit)

- statusline-setup: Use this agent to configure the user's Claude Code status line setting. (Tools: Read, Edit)


Now I need to update the docblock and status line to remove the incorrect exclusion description.


# Remainder mode (weekly):
#   Targets all currently running containers NOT in:
#     DAILY_RESTART_CONTAINERS       — already updated daily
#     emby + critical-data profiles  — updated inline by the weekly sync window
#     WEEKLY_RESTART_CONTAINERS      — restarted by docker_weekly_restart.sh after sync
#     FALLBACK_*_TIER*               — owned by the remote server's update cycle

# Remainder mode (weekly):
#   Targets all currently running containers NOT in:
#     DAILY_RESTART_CONTAINERS       — already updated daily
#     emby + critical-data profiles  — updated inline by the weekly sync window
#     FALLBACK_*_TIER*               — owned by the remote server's update cycle
#   WEEKLY_RESTART_CONTAINERS are included — docker_weekly_restart.sh restarts
#   them but doesn't pull images; remainder is the only place they get updated.


# Remainder mode (weekly):
#   Targets all currently running containers NOT in:
#     DAILY_RESTART_CONTAINERS       — already updated daily
#     emby + critical-data profiles  — updated inline by the weekly sync window
#     WEEKLY_RESTART_CONTAINERS      — restarted by docker_weekly_restart.sh after sync
#     FALLBACK_*_TIER*               — owned by the remote server's update cycle

# Remainder mode (weekly):
#   Targets all currently running containers NOT in:
#     DAILY_RESTART_CONTAINERS       — already updated daily
#     emby + critical-data profiles  — updated inline by the weekly sync window
#     FALLBACK_*_TIER*               — owned by the remote server's update cycle
#   WEEKLY_RESTART_CONTAINERS are included — docker_weekly_restart.sh restarts
#   them but doesn't pull images; remainder is the only place they get updated.

-#     WEEKLY_RESTART_CONTAINERS      — restarted by docker_weekly_restart.sh after sync

+#   WEEKLY_RESTART_CONTAINERS are included — docker_weekly_restart.sh restarts

+#   them but doesn't pull images; remainder is the only place they get updated.

#   Pull → compare → prune dangling images.


echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, weekly restart, and fallback)"

echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, and fallback)"


echo "$ICON_HOST       Identity:   $MY_ID ($LOCAL_SERVER_NAME)"

echo "$ICON_GEAR       Mode:       $([[ "$REMAINDER_MODE" == true ]] && echo "remainder" || echo "normal (daily)")"

if [[ "$REMAINDER_MODE" == true ]]; then

-        echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, weekly restart, and fallback)"

+        echo "$ICON_CONTAINERS Containers: ${#TARGET_CONTAINERS[@]} running (excluding daily, weekly sync, and fallback)"

for _c in "${TARGET_CONTAINERS[@]}"; do echo "  $_c"; done

echo "$ICON_CONTAINERS Containers: ${TARGET_CONTAINERS[*]}"


Bash

cd /boot/config/plugins/varaverk && git add Docker_Essentials/docker_update.sh && git commit -m "$(cat <<'EOF'
Include WEEKLY_RESTART_CONTAINERS in remainder updates

docker_weekly_restart.sh restarts them but never pulls images — remainder
is the only update path they have.
EOF
)"

Commit fix for WEEKLY_RESTART_CONTAINERS exclusion


[main bfc3cbe] Include WEEKLY_RESTART_CONTAINERS in remainder updates
 1 file changed, 3 insertions(+), 7 deletions(-)
Shell cwd was reset to /root


cd /boot/config/plugins/varaverk && git push

Push the fix


remote: . Processing 1 references
remote: Processed 1 references in total
To ssh://192.168.50.2:221/FailedProxy/Varaverk.git
   a5292c4..bfc3cbe  main -> main
Shell cwd was reset to /root


Correct — `WEEKLY_RESTART_CONTAINERS` (NextCloud, AdGuard, Immich, Organizrr) belong in remainder. `docker_weekly_restart.sh` only restarts them; it never pulls. If they're excluded from remainder they'd never get image updates at all. The exclusion I added last session was wrong and is now reverted.


ok, so at the time i didnt have a monthly orch... daily needs to update its containers, weekly its containers and we need to move remainder to montly


Let me look at both orchestrators to understand the current state before touching anything.


Find remainder references in weekly


17:#   9. docker_update.sh --remainder  — update all containers not in daily or weekly sync window
381:DOCKER_UPDATE_SCRIPT="$SCRIPTS_ROOT/Docker_Essentials/docker_update.sh"
383:    warn "docker_update.sh not found — skipping remainder updates"
384:    JOB_FAIL+=("docker_update.sh --remainder")
386:    _remainder_args=("--remainder")
387:    [[ "$DRY_RUN" == true ]] && _remainder_args+=("--dry-run")
388:    if bash "$DOCKER_UPDATE_SCRIPT" "${_remainder_args[@]}"; then
390:        JOB_PASS+=("docker_update.sh --remainder")
393:        JOB_FAIL+=("docker_update.sh --remainder")
395:    unset _remainder_args


grep -n "remainder\|docker_update\|REMAINING\|MONTHLY_REMAINING" /boot/config/plugins/varaverk/Orchestrators/monthly_maintenance.sh | head -40

Find update references in monthly


(Bash completed with no output)