← Back to Skills Marketplace
ericlooi504

Backup Rotator

by ericlooi504 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
14
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install backup-rotator
Description
Smart backup rotation and retention manager. Create backups, enforce flexible retention policies (grandfather-father-son), verify integrity, and clean up old...
README (SKILL.md)

Backup Rotator

Create, rotate, and verify backups with configurable retention policies. Uses only Python standard library — no pip install needed.

Quick start

# Create a backup
python3 skills/backup-rotator/scripts/backup_rotator.py --backup /path/to/source /path/to/backups

# Create backup with compress
python3 skills/backup-rotator/scripts/backup_rotator.py --backup /path/to/dir /backups --compress

# List existing backups
python3 skills/backup-rotator/scripts/backup_rotator.py --list /backups --name myproject

# Rotate (clean old backups)
python3 skills/backup-rotator/scripts/backup_rotator.py --rotate /backups --name myproject

# Dry run (see what would be deleted)
python3 skills/backup-rotator/scripts/backup_rotator.py --rotate /backups --name myproject --dry-run

# Verify backup integrity
python3 skills/backup-rotator/scripts/backup_rotator.py --verify /backups

Retention Policy (default)

Category Keep Description
Daily 7 Most recent daily backups
Weekly 4 Most recent Sunday backups
Monthly 3 First 7 days of each month
Old 0 Beyond all retention → deleted

Default policy keeps 14 backups minimum.

Config File (for cron)

Create a JSON config file for fully automated backup + rotation:

{
  "backup_source": "/var/lib/postgresql/database.dump",
  "backup_dest": "/backups/db",
  "backup_name": "postgres",
  "keep_daily": 7,
  "keep_weekly": 4,
  "keep_monthly": 3,
  "compress": true,
  "verify": true
}

Then run:

python3 skills/backup-rotator/scripts/backup_rotator.py --cron config.json

Output:

  Backup Rotator — 2026-05-10 13:30:00
  ==================================================
  Name prefix:       postgres
  Keep daily:        7
  Keep weekly:       4
  Keep monthly:      3
  Compress:          yes
  Verify:            yes

  📦 Creating backup...
  Compressing /var/lib/postgresql/database.dump → /backups/db/postgres_20260510-133000.tar.gz
  Size:    42.3M
  SHA256:  a1b2c3d4e5f6...

  🔄 Rotating old backups...
  Summary: 12 keep, 3 delete
  Keeping:
    ✅ postgres_20260510-133000.tar.gz (42.3M) - keep (daily)
    ✅ postgres_20260509-020000.tar.gz (41.8M) - keep (daily)
    ...
  Deleting:
    🗑  postgres_20260428-020000.tar.gz (40.1M) - delete (past retention)

  ✅ Verifying remaining backups...
  ✅ postgres_20260510-133000.tar.gz SHA256: a1b2...
  ✅ postgres_20260509-020000.tar.gz SHA256: b2c3...

Common commands

Command Action
--backup SOURCE DEST Create timestamped backup
--list DIR List all backups with age and category
--rotate DIR Apply retention policy, delete old backups
--dry-run Preview rotation without deleting
--verify DIR Check SHA256 checksums of all backups
--cron config.json Full automated run: backup + rotate + verify
--name PREFIX Filter backup files by name prefix
--compress Compress directory backups to tar.gz
--no-verify Skip SHA256 verification

Automation with Cron

Add to crontab for daily automated backups:

# Daily at 2am
0 2 * * * cd /home/user && python3 skills/backup-rotator/scripts/backup_rotator.py --cron /home/user/configs/backup-postgres.json >> /var/log/backup-rotator.log 2>&1

Requirements

  • Python 3.6+ (no pip install needed)
  • Uses only standard library: os, shutil, hashlib, json, argparse
  • Works on Linux, macOS (partial)
  • No external API calls — fully offline
Usage Guidance
This skill appears safe to install for local backup rotation if you understand that it can delete matching backup files. Use `--dry-run` before real rotation, keep backups in a dedicated directory, verify the configured source and destination paths, and review any cron job before enabling unattended runs.
Capability Analysis
Type: OpenClaw Skill Name: backup-rotator Version: 1.0.0 The backup-rotator skill is a legitimate utility for managing file backups and retention policies. The Python script (scripts/backup_rotator.py) uses standard libraries to perform file copying, compression via the system 'tar' utility, and integrity verification using SHA256 checksums. No evidence of malicious intent, data exfiltration, or prompt injection was found; the code's behavior aligns strictly with its documented purpose of automating backup rotation.
Capability Assessment
Purpose & Capability
The backup, rotation, checksum, and cleanup capabilities match the stated purpose, but cleanup is inherently destructive if pointed at the wrong backup directory.
Instruction Scope
The documentation discloses rotate, dry-run, verify, and cron modes; users should explicitly choose dry-run before enabling real deletion.
Install Mechanism
There is no install spec or package dependency, but compressed directory backups invoke the system tar command, which is not declared as a required binary.
Credentials
The script operates on user-supplied local paths, creates backup directories, copies files, computes hashes, and removes matching backup files; this is proportionate for a backup rotator but requires careful path selection.
Persistence & Privilege
The skill does not add persistence by itself, but it provides user-directed cron instructions for recurring automated backup and rotation.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install backup-rotator
  3. After installation, invoke the skill by name or use /backup-rotator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: backup creation, GFS rotation, integrity verification, cron mode
Metadata
Slug backup-rotator
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Backup Rotator?

Smart backup rotation and retention manager. Create backups, enforce flexible retention policies (grandfather-father-son), verify integrity, and clean up old... It is an AI Agent Skill for Claude Code / OpenClaw, with 14 downloads so far.

How do I install Backup Rotator?

Run "/install backup-rotator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Backup Rotator free?

Yes, Backup Rotator is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Backup Rotator support?

Backup Rotator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Backup Rotator?

It is built and maintained by ericlooi504 (@ericlooi504); the current version is v1.0.0.

💬 Comments