remote-system-maintenance

📁 neversight/skills.sh_feed 📅 14 days ago
1
总安装量
1
周安装量
#50821
全站排名
安装命令
npx skills add https://github.com/neversight/skills.sh_feed --skill remote-system-maintenance

Agent 安装分布

mcpjam 1
claude-code 1
kilo 1
junie 1
windsurf 1

Skill 文档

Remote 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:

  1. Package Cache Refreshapt update to sync package lists
  2. System Upgradesapt upgrade for security and bug fixes
  3. Orphan Removalapt autoremove to clean unused dependencies
  4. Cache Purgingapt clean to reclaim package cache space
  5. Journal Pruningjournalctl --vacuum-time=7d to limit log retention
  6. Snap Revision Cleanup – Remove disabled snap revisions (see below)
  7. Temporary Directory Assessment – Review /tmp and /var/tmp for 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:

  1. System Identification

    • Hostname
    • OS version
    • Kernel information
    • Operator identity
  2. Resource States

    • Initial disk/memory/CPU usage
    • Final disk/memory/CPU usage
    • Quantified improvements
  3. Actions Taken

    • Specific commands executed
    • MB/GB freed per category
    • Packages upgraded/removed
  4. 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.