# Free Disk on a Live Trading Host Without Downtime

> Safe disk cleanup on a live trading host: scout, build a categorised deletion manifest with safety checks, get one explicit approval, delete, keep a ledger of removed binaries, and prove the trader kept its PID.

Free Disk on a Live Trading Host Without Downtime is a paid AI agent skill on Agensi by Claude Workflow Lab, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $7 (one-time purchase)
- Creator: [Claude Workflow Lab](https://www.agensi.io/creators/creator-1578)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 1.0.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/free-disk-on-a-live-trading-host-without-downtime
- Tags: devops, disk, cleanup, pm2, logrotate, linux, trading, safety

## What it does

- Scans the server to find the largest folders and old service backups
- Checks if files are currently open or locked by a running process before suggesting deletion
- Creates a ledger of deleted files including their version details for future audits
- Fixes common log rotation bugs that prevent old logs from being compressed
- Verifies your trading process ID remains unchanged after the cleanup is finished

## Who it's for

- **Founders running a live trading bot:** Free up server space without stopping your bot or losing money. Try: "Check my trading server for files I can safely delete."
- **DevOps for financial services:** Clean production hosts with a permanent record of which binaries were deleted. Try: "Build a cleanup manifest for the main trading host."
- **Freelance server admins:** Fix log rotation issues and clear caches on Linux servers safely. Try: "Fix the log compression issue on this server."

## About this skill

A full disk on a host that is trading is an emergency where the wrong rm can be worse than the problem. This skill gives an agent a conservative, auditable cleanup that never touches the running processes.

What is inside:
- **SKILL.md** - the procedure: scout what is large and why, build a categorised manifest (rollback binaries, rotated logs, caches, build leftovers) with safety checks per item (is it the running executable, does a process hold it open, does it have hard links, is it referenced by a config or a socket), show the manifest and ask once, delete, then prove the trader's PID and start time did not change. It also covers stopping the host from refilling after every deploy.
- **scripts/manifest.sh** - builds the candidate list with the safety checks, deleting nothing.
- **scripts/ledger.sh** - records each binary's identity (mtime, sha256, Go version, module lines) before it is deleted, so "which build ran during that incident" stays answerable.
- **scripts/execute.sh** - deletes exactly the approved manifest.
- **scripts/pm2-logrotate-compress-fix.sh** - repairs pm2-logrotate so rotated logs get compressed.

For operators of their own trading hosts. Deletion always waits for your explicit approval of the manifest. Needs SSH, sudo and bash. Also part of the Crypto Trading Ops Playbooks pack at a lower per-skill price.

## Requires

- bash and standard coreutils (du, find, lsof, stat)

pm2-logrotate if you use the log-rotation fix.

## Known limitations

This skill requires sudo access on the host. It does not automatically delete Docker volumes to avoid data loss.

## Technical details

Built for Linux hosts running trading services under PM2. Uses SSH for scouting and scp to deploy bash scripts (manifest.sh, ledger.sh, execute.sh). Performs safety checks via lsof and fuser to identify open file descriptors and running executables. Captures Go module pins from ELFs using strings for the audit ledger. Includes a specific patch for pm2-logrotate 3.0.0 boolean casting bugs.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Free Disk on a Live Trading Host Without Downtime skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill free up space without breaking my trading bot?

This skill helps free up disk space on a live trading server without stopping the bot or changing its process ID. It identifies safe items to delete such as old binary backups, temporary files, and hidden caches while ensuring no active trading files or sockets are touched.

### What do I need to have ready to use this skill?

You need a Linux host running trading services under PM2 and SSH access to that server. You also need to provide the specific folder names for your services and the names of your apps in PM2 so the cleanup scripts know what to protect.

### How does it know which files are safe to delete?

It performs safety checks to see if a file is currently being used by a running process or held open by a log tool. It also checks for hard links and references in system files to make sure deleting a file won't cause a crash or lose the only copy of important data.

### What kind of reports or records will I get after the cleanup?

You receive a categorized manifest of files suggested for removal, a ledger that records the details and version history of deleted binaries, and a final confirmation that your trading process is still running with the same ID. It also provides a fix for common logging issues where files are not being compressed correctly.

### Are there any types of files this skill will not touch?

This skill is designed for specific file types like logs and backups, so it does not automatically handle Docker volumes or database data. It also avoids deleting important provenance files that record which specific code version was used for a build.

### How do I tell my agent to start the cleanup process?

You can ask your agent to scout your server for large folders or tell it you have a no space left on device error and need a safe cleanup. You will then be asked to review a list of files and provide a single approval before any deletions happen.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
