Skip to main content
Community Scripts logo
Skip to Content
Tools & Add-onsPVE Tools

update-lxcs-cron (worker)

The non-interactive script that the PVE Cron LXC Updater installs and cron runs to update all LXC containers.

update-lxcs-cron.sh is the worker behind PVE Cron LXC Updater. That manager installs it as /usr/local/bin/update-lxcs.sh. It has no dialogs and is not listed on the website on its own.

Source: tools/pve/update-lxcs-cron.sh.

Run

Install it through the manager and let cron run it, or start the installed copy by hand on the Proxmox VE host as root:

/usr/local/bin/update-lxcs.sh

Container IDs given as arguments are skipped, in addition to the ones in the config file:

/usr/local/bin/update-lxcs.sh 100 105

What it does

For every container from pct list that is not excluded and not a template:

  1. A stopped container is started and given 5 seconds.
  2. The update command for the container's ostype runs through pct exec.
  3. If /usr/local/bin/patchmon-agent exists in the container, patchmon-agent report is run.
  4. A container that was started in step 1 is shut down with pct shutdown <id> --timeout 60.
ostypeCommand inside the container
alpineapk -U upgrade
archlinuxpacman -Syyu --noconfirm
fedora, rocky, centos, almadnf -y update && dnf -y upgrade
ubuntu, debian, devuanapt-get update, then DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::='--force-confold' dist-upgrade -y, then removes /usr/lib/python3.*/EXTERNALLY-MANAGED
opensusezypper ref && zypper --non-interactive dup
anything elseSkipped with [Warn] Unknown OS type.

--force-confold keeps your existing configuration files when a package ships a new version of one.

Configuration

The worker reads /etc/update-lxcs.conf:

KeyEffect
EXCLUDEComma-separated container IDs to skip. Only digits and commas are read.
PING_URLHealthchecks-style URL. The worker requests <PING_URL>/start first and, when it exits, posts /var/log/update-lxcs-cron.log to <PING_URL> (all updates succeeded) or <PING_URL>/fail (at least one failed).

When PING_URL is set, the worker truncates /var/log/update-lxcs-cron.log at the start so that only the current run is sent.

Limits

  • The worker writes to standard output. The log file only fills because the cron entry redirects into it.
  • Unlike the interactive PVE LXC Updater it does not run autoremove or autoclean and does not report pending reboots.
  • It reads no environment variables and sets its own PATH.
On this page

On this page