Skip to content

zupdate - Complete System Maintenance

One-command maintenance that performs git sync, cache optimization, compilation, and integrity checks. Think of it as apt update for your shell configuration.

Overview

zupdate is the recommended way to keep your ZSHAND installation current. It checks network connectivity, pulls the latest changes from git, prunes stale branches, fixes permissions, cleans cache artifacts, recompiles the framework, runs integrity checks, and optionally displays stability metrics.

When to use: Weekly, after pulling remote changes, or whenever you want to ensure everything is up to date and healthy.

Usage

zupdate

No arguments or options — it runs the full maintenance cycle every time.

Examples

# Weekly maintenance
zupdate

# Add to cron for automatic upkeep (Sunday 3am)
0 3 * * 0 /path/to/zshand/bin/zupdate

What It Does

Operations run in this order:

  1. Network check — Pings 8.8.8.8 with a 1-second timeout. If offline, git operations are skipped gracefully.
  2. Git sync — Fetches with --prune, pulls with --rebase, warns if local is behind remote. Runs zbranch-clean if available.
  3. Permissions — Runs chmod +x on all scripts in bin/.
  4. Cache hygiene — Deletes stale .zwc.old files left from previous compilations.
  5. Recompilation — Calls zprime --quiet (or zr --quiet as fallback) to rebuild all bundles.
  6. Integrity audit — Runs zcheck to verify environment health.
  7. Stability report — Shows 24-hour success rate via zpulse if available.

Offline Behavior

When the network check fails, zupdate skips git fetch/pull/branch cleanup and continues with local operations (permissions, compilation, integrity checks). This makes it safe to run anywhere.

Dependencies

  • Required: ping, git, chmod
  • Required: zprime or zr (compilation)
  • Optional: zcheck (integrity audit), zbranch-clean (git cleanup), zpulse (telemetry)

See Also

  • zr — Rebuild only (no git sync or maintenance)
  • zrebuild — Force rebuild with syntax validation
  • zfresh — Clean rebuild with shell restart