run - Execute Update Checks

run - Execute Update Checks

The run command is the primary entry point for Update-Watcher. It executes all configured update checkers, collects the results, and sends notifications through the configured channels. This is the command that cron jobs invoke on a schedule.

Usage

Terminal
update-watcher run [flags]

Flags

FlagTypeDefaultDescription
--formattext|jsontextOutput format. Use json for machine-readable output suitable for scripting and pipelines.
--only TYPEstring(all)Run only the specified checker type (e.g., apt, docker, wordpress). All other checkers are skipped.
--notify BOOLbool(config)Control notification delivery. true forces notifications regardless of send policy. false suppresses all notifications. Omit to follow the configured send_policy.
--quietfalseSuppress all output except errors.
--verbosefalseEnable verbose debug output.
The --notify flag overrides the send_policy setting in your configuration. When omitted, the configured policy applies (see Send Policy).

Exit Codes

The run command uses exit codes to communicate results for scripting:

CodeMeaningDescription
0No updatesAll checkers ran successfully and no updates were found.
1Updates foundAt least one checker reported available updates.
2Partial failureSome checkers succeeded, but at least one failed (e.g., network timeout, missing permissions).
3Complete failureAll configured checkers failed.
4Config errorThe configuration file is missing, malformed, or contains invalid values.

For detailed scripting examples using exit codes, see Exit Codes.

Examples

Basic Run

Execute all configured checkers and send notifications according to the configured send_policy:

Terminal
update-watcher run

JSON Output

Output results as JSON for parsing by other tools:

Terminal
update-watcher run --format json

Combine with jq to extract specific information:

Terminal
update-watcher run --format json | jq '.checkers[] | select(.updates > 0)'

For more JSON output examples, see JSON Output.

Run a Single Checker

Run only the APT checker, skipping all other configured checkers:

Terminal
update-watcher run --only apt

This is useful for testing a specific checker or debugging issues with a single package manager.

Suppress Notifications

Run all checks but do not send any notifications. Results are printed to the terminal only:

Terminal
update-watcher run --notify=false

This is equivalent to a “dry run” and is useful for verifying that checkers are working before enabling notifications.

Force Notifications

Force notifications to be sent even if no updates are found, regardless of the configured send_policy:

Terminal
update-watcher run --notify=true

This is useful for testing notification delivery or as a heartbeat confirmation.

Quiet Mode for Cron

Run silently with no terminal output. Only errors are printed to stderr:

Terminal
update-watcher run --quiet

This is the mode used by the cron job created with update-watcher install-cron.

Verbose Debug Output

Enable detailed logging to diagnose issues:

Terminal
update-watcher run --verbose

The verbose output shows each step: config loading, checker initialization, package manager queries, result parsing, and notification delivery.

Combining Flags

Run only the Docker checker with JSON output and no notifications:

Terminal
update-watcher run --only docker --format json --notify=false

Typical Cron Entry

When scheduled via update-watcher install-cron, the cron entry looks like:

Crontab
0 7 * * * /usr/local/bin/update-watcher run --quiet

For dedicated service user setups:

Crontab
0 7 * * * /usr/local/bin/update-watcher run --quiet --as-service-user
💡
Schedule checks during off-peak hours to avoid competing with package manager lock files and to receive notifications before you start your workday. See Cron Scheduling for more scheduling options.

Related