swarmexec

swarmexec › Docs › Volumes & prune schedule

Volumes & prune schedule_

Node-local volumes, seen and cleaned up cluster-wide.

volume ls — list volumes

Lists volumes across all nodes and which nodes hold each. Swarm volumes are node-local, so the client queries every node and aggregates. Optional substring name filter. Columns: VOLUME  DRIVER  NODES  USED BY  AGE (plus SIZE with --size). AGE is compact: 3d4h up to 30 days, then 3mo / 4y.

swarmexec volume ls [name-filter]
FlagDefaultDescription
--sizefalsealso compute each volume's on-disk size (slower: du per volume)
--sortnamesort by: name | nodes | used | age | size (size implies --size)
--reversefalsereverse the sort direction
--connect-timeout10sper-node connect timeout
--jsonfalseoutput JSON instead of a table

volume rm — remove a volume

Remove a volume on every node that holds it (--all) or on specific nodes (--node, repeatable). One of the two is required.

swarmexec volume rm <name> (--all | --node N …)
FlagDefaultDescription
--allfalseremove on every node that holds the volume
--node—remove only on these nodes (repeatable)
--forcefalsepass docker's force flag
-y, --yesfalsedo not prompt for confirmation
--connect-timeout10sper-node connect timeout

node ls / node prune / node update — the nodes

The Nodes tab on the command line, running the same code. node ls lists every node — role, availability, state, engine, running tasks, the volume count its agent reports (- when the agent did not answer; --skip-agents does not ask) and the number of labels; --json gives every field, the labels themselves included. A node is named by hostname, id or a unique id prefix.

swarmexec node ls swarmexec node prune worker-1 swarmexec node prune worker-1 --categories containers,images --yes swarmexec node update worker-1 --availability drain --yes swarmexec node update worker-1 --label-add zone=b --label-rm old

node prune is the TUI's node prune: it shows what each category would free, as the agent last measured it, then asks. Without --categories it sweeps the safe ones — stopped containers, untagged images, build cache, unused local networks. images (every unused image, those of services scaled to zero included) and volumes (data, named volumes included) are pruned only when named. Without a terminal and without --yes nothing is pruned; a category that fails on the node is the exit code (125).

node update sets availability and labels. It applies at once — a node has no rolling update. drain moves every task off the node, so it asks first; active and pause apply directly.

Command / flagDescription
node ls --jsonJSON instead of the table; volumes is null where the agent did not answer
node prune --categoriescomma list of containers, images, dangling-images, buildcache, networks, volumes (images already includes dangling-images)
node prune --containers-untilkeep stopped containers this long after they stop (default 24h; 0 keeps none)
node update --availabilityactive, pause or drain
node update --label-add / --label-rmadd or change key=value / remove key; repeatable
-y, --yesdo not prompt (prune, drain)

node prune-schedule — the agents' prune schedule

Shows or sets the cluster-wide prune schedule. show prints it with the next five runs; set changes only the flags you give and enables the schedule. Saving updates the agent service, so the agents restart one by one; the command asks first. It was the top-level prune-schedule, which still works.

swarmexec node prune-schedule show swarmexec node prune-schedule set --days mon-fri --start 03:00 --times 2 --tz Europe/Berlin
Flag (set)DefaultDescription
--daysevery daymon,tue,… or ranges like mon-fri
--start00:00first run of the day, HH:MM
--times1runs per day (1–24), the day split evenly from --start
--tzUTCIANA time zone of --days and --start
--categoriescontainers,images,buildcache,networksalso dangling-images and volumes
--containers-until24hkeep stopped containers this long after they stop; 0 keeps none
--label-filter—only prune objects with these labels; - clears
--disablefalseturn the schedule off and keep its settings
-y, --yesfalsedo not prompt before the agents restart