remote-system-maintenance
Scannednpx machina-cli add skill aiskillstore/marketplace/remote-system-maintenance --openclawRemote System Maintenance
Purpose
Structured guidance for diagnosing and maintaining remote Linux systems through SSH/tmux sessions, with emphasis on Ubuntu/Debian platforms.
Applicable Scenarios
- System maintenance tasks
- Disk space recovery
- Package updates
- Health diagnostics
- Cleanup operations on remote servers
Three-Phase Approach
Phase 1: Initial Diagnostics
Capture baseline system state:
- Hostname and system identification
- Resource utilization (disk, memory, CPU)
- Process status and load
- Zombie process detection
Phase 2: System Log Review
Examine system health indicators:
- Recent error messages in system logs
- Journal disk consumption analysis
- Critical service status
- Authentication and security events
Phase 3: Package Assessment
Identify maintenance opportunities:
- Upgradable packages
- Orphaned configurations
- Unused dependencies
- Package cache size
Ubuntu/Debian Cleanup Sequence
Execute these seven stages in order:
- Package Cache Refresh -
apt updateto sync package lists - System Upgrades -
apt upgradefor security and bug fixes - Orphan Removal -
apt autoremoveto clean unused dependencies - Cache Purging -
apt cleanto reclaim package cache space - Journal Pruning -
journalctl --vacuum-time=7dto limit log retention - Snap Revision Cleanup - Remove disabled snap revisions (see below)
- Temporary Directory Assessment - Review
/tmpand/var/tmpfor cleanup opportunities
Snap Revision Cleanup Technique
Snap keeps old revisions by default. To identify and remove:
# List all disabled snap revisions
snap list --all | awk '/disabled/{print $1, $3}'
# Remove specific revision
snap remove <package-name> --revision=<revision-number>
Important: Requires explicit removal by revision number, not simple package uninstallation.
Documentation Requirements
All maintenance sessions must generate structured logs recording:
-
System Identification
- Hostname
- OS version
- Kernel information
- Operator identity
-
Resource States
- Initial disk/memory/CPU usage
- Final disk/memory/CPU usage
- Quantified improvements
-
Actions Taken
- Specific commands executed
- MB/GB freed per category
- Packages upgraded/removed
-
Follow-up Recommendations
- Remaining issues
- Future maintenance needs
- Monitoring suggestions
Expected Results
Real-world recovery examples:
- Journal vacuuming: 300-600 MB
- Snap revision cleanup: 500 MB to 2 GB
- Package cache purging: 100-500 MB
- Total potential: 2+ GB in comprehensive sessions
Time Commitment
Typical maintenance session: 15-30 minutes including diagnostics, cleanup, and documentation.
Source
git clone https://github.com/aiskillstore/marketplace/blob/main/skills/2389-research/remote-system-maintenance/SKILL.mdView on GitHub Overview
Provides structured, three-phase guidance for diagnosing and maintaining remote Linux hosts via SSH/tmux, with a focus on Ubuntu/Debian. It helps ensure system health, frees disk space, and keeps packages up to date.
How This Skill Works
It operates over SSH/tmux to guide you through a three-phase checklist: Phase 1 collects baseline host data (hostname, OS, kernel, resources, processes, zombie state); Phase 2 reviews system logs, journal usage, service status, and security events; Phase 3 assesses packages for upgrades, orphaned configurations, unused dependencies, and cache size. After assessment, it executes the Ubuntu/Debian cleanup sequence (seven stages) and logs all actions with quantified results.
When to Use It
- System maintenance tasks on remote servers
- Disk space recovery and cleanup
- Package updates and security fixes
- Health diagnostics for Linux hosts
- Cleanup operations on remote servers
Quick Start
- Step 1: Connect to the remote host via SSH and start a tmux session.
- Step 2: Run Phase 1–3 diagnostics to capture baseline metrics and health indicators.
- Step 3: Execute the seven-stage Ubuntu/Debian cleanup sequence and generate structured logs.
Best Practices
- Always start with a baseline capture: hostname, OS version, kernel, and current resource usage.
- Review logs and journal consumption before performing cleanup to avoid missing issues.
- Follow the seven-stage Ubuntu/Debian cleanup sequence in order (update, upgrade, autoremove, clean, journal prune, snap cleanup, tmp review).
- Document actions with quantified outcomes (MB/GB freed, packages upgraded or removed).
- Identify and remove old Snap revisions explicitly using revision numbers, not by package uninstall.
Example Use Cases
- Journal vacuuming: 300-600 MB reclaimed.
- Snap revision cleanup: 500 MB to 2 GB recovered.
- Package cache purging: 100-500 MB freed.
- Total potential cleanup: 2+ GB in comprehensive sessions.
- Typical maintenance session: 15-30 minutes including diagnostics and documentation.