remote-system-maintenance
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:
- 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.
More from neversight/skills.sh_feed
python-async-patterns
Python asyncio patterns for concurrent programming. Triggers on: asyncio, async, await, coroutine, gather, semaphore, TaskGroup, event loop, aiohttp, concurrent.
25tmux-processes
Patterns for running long-lived processes in tmux. Use when starting dev servers, watchers, tilt, or any process expected to outlive the conversation.
6tamagui-best-practices
Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).
3python-typing-patterns
Python type hints and type safety patterns. Triggers on: type hints, typing, TypeVar, Generic, Protocol, mypy, pyright, type annotation, overload, TypedDict.
2using-xtool
This skill should be used when building iOS apps with xtool (Xcode-free iOS development), creating xtool projects, adding app extensions, or configuring xtool.yml. Triggers on "xtool", "SwiftPM iOS", "iOS on Linux", "iOS on Windows", "Xcode-free", "app extension", "widget extension", "share extension". Covers project setup, app extensions, and deployment.
2explain
Deep explanation of complex code, files, or concepts. Routes to expert agents, uses structural search, generates mermaid diagrams. Triggers on: explain, deep dive, how does X work, architecture, data flow.
1