openclaw-maintain

📁 anthemflynn/ccmp 📅 Feb 14, 2026
10
总安装量
10
周安装量
#30235
全站排名
安装命令
npx skills add https://github.com/anthemflynn/ccmp --skill openclaw-maintain

Agent 安装分布

openclaw 10
opencode 8
gemini-cli 7
github-copilot 7
codex 7
amp 7

Skill 文档

!openclaw daemon status 2>&1 | head -10 !openclaw cron status 2>&1 | head -10

OpenClaw Maintain — Keep It Running

You are an OpenClaw maintenance operator. Handle daemon lifecycle, updates, log management, cron scheduling, session cleanup, memory indexing, and sandbox management.

Scope

This skill covers operational maintenance — keeping the system running day-to-day:

  • Daemon (gateway service) lifecycle
  • CLI and gateway updates
  • Log rotation and cleanup
  • Cron job management
  • Session cleanup
  • Memory index maintenance
  • Sandbox container management

For configuration changes, use openclaw-admin. For diagnostics, use openclaw-doctor. For adding new capabilities, use openclaw-extend.


Daemon Management

Status Check

openclaw daemon status        # service status + gateway probe
openclaw gateway status       # gateway-level status
openclaw gateway probe        # full reachability check

Lifecycle Commands

openclaw daemon start         # start the service
openclaw daemon stop          # stop the service
openclaw daemon restart       # restart the service
openclaw daemon install       # install as system service
openclaw daemon uninstall     # remove system service

Troubleshooting

Gateway won’t start:

openclaw daemon status        # check if already running
openclaw gateway status       # check port conflicts
openclaw gateway --force      # kill existing listener, then start

Gateway crashes on start:

openclaw logs --limit 50      # check recent logs for errors
openclaw doctor               # run health check

Platform-specific details: See references/daemon-reference.md.


Updates

Check for Updates

openclaw update status        # current vs latest, channel info

Apply Update

openclaw update               # update (git checkout or npm)
openclaw update --yes         # non-interactive
openclaw update --no-restart  # update without restarting service

Channel Management

openclaw update --channel stable   # switch to stable
openclaw update --channel beta     # switch to beta
openclaw update --channel dev      # switch to dev
openclaw update --tag <version>    # one-off version

Post-Update Verification

openclaw daemon status        # service running?
openclaw status --all         # full health check
openclaw channels status --probe  # channels reconnected?

Log Management

View Logs

openclaw logs                 # recent gateway logs
openclaw logs --follow        # live tail
openclaw logs --limit 100     # last 100 lines
openclaw channels logs        # channel-specific logs

Log Rotation / Cleanup

du -sh ~/.openclaw/logs/      # check log size
ls -lah ~/.openclaw/logs/     # list log files

If error log > 10MB:

# Rotate the error log
mv ~/.openclaw/logs/error.log ~/.openclaw/logs/error.log.$(date +%Y%m%d)
openclaw daemon restart       # restart to create fresh log

Clean old rotated logs:

ls -t ~/.openclaw/logs/error.log.* 2>/dev/null | tail -n +4  # keep 3 most recent

Cron Job Management

View Jobs

openclaw cron list            # all jobs
openclaw cron status          # scheduler status
openclaw cron runs            # run history

Manage Jobs

openclaw cron add             # add a job (interactive)
openclaw cron edit <name>     # edit a job
openclaw cron enable <name>   # enable a job
openclaw cron disable <name>  # disable a job
openclaw cron rm <name>       # remove a job
openclaw cron run <name>      # run immediately (debug)

Cron expression syntax and job schema: See references/cron-reference.md.


Session Management

View Sessions

openclaw sessions             # all sessions
openclaw sessions --active 120  # active in last 2 hours
openclaw sessions --json      # machine-readable

Session Cleanup

Old sessions consume disk. Clean periodically:

openclaw sessions             # review what exists
openclaw sessions --active 120  # see what's recent

Memory Index Maintenance

Check Index Health

openclaw memory status --deep   # full index status

Healthy index: Not dirty, chunk count > 0, file count > 0, agent name matches.

Reindex

openclaw memory index           # rebuild index
openclaw memory status --deep   # verify after reindex

When to reindex:

  • After manually adding/removing files from ~/.openclaw/workspace/memory/
  • When memory status --deep shows dirty flag
  • When search returns stale or missing results
  • After agent name change

Sandbox Management

View Containers

openclaw sandbox list           # all containers
openclaw sandbox list --browser # browser containers only
openclaw sandbox explain        # effective sandbox policy

Recreate Containers

openclaw sandbox recreate --all           # recreate all
openclaw sandbox recreate --session main  # specific session
openclaw sandbox recreate --agent <name>  # agent containers

When to recreate:

  • After changing sandbox config
  • Container in error state
  • After Docker image update

Disk Usage

Check Sizes

du -sh ~/.openclaw/           # total
du -sh ~/.openclaw/logs/      # logs
du -sh ~/.openclaw/workspace/ # workspace
du -sh ~/.openclaw/state/     # state

Cleanup Targets

Path Safe to Clean How
~/.openclaw/logs/error.log.* Yes (rotated logs) rm old rotated logs
~/.openclaw/openclaw.json.bak* Yes (config backups) Keep latest, remove rest
~/.openclaw/state/ Mostly (old state files) Review before removing

Maintenance Schedules

Daily (automated via cron):

  • Heartbeat fires (if configured)
  • Sessions auto-expire

Weekly:

openclaw doctor               # health check
openclaw status --all         # overview
openclaw update status        # check for updates

Monthly:

openclaw memory status --deep # index health
openclaw memory index         # reindex if dirty
du -sh ~/.openclaw/logs/      # log size check
openclaw update               # apply updates

As needed:

openclaw sessions --active 120  # session cleanup
openclaw daemon restart         # if issues arise
openclaw sandbox recreate --all # if containers stale

Full playbooks: See references/maintenance-playbooks.md.

References

  • references/daemon-reference.md — Service paths, platform differences, ports
  • references/cron-reference.md — Job schema, expression syntax, common schedules
  • references/maintenance-playbooks.md — Step-by-step runbooks

Related Skills

  • openclaw-doctor — Run a health audit to identify maintenance needs
  • openclaw-admin — Apply config changes with verify-apply-verify discipline
  • openclaw-extend — Add plugins, channels, nodes, webhooks