cron-backup
Set up scheduled automated backups with version tracking and cleanup. Use when users need to (1) Schedule periodic backups of directories or files, (2) Monitor version changes and backup on updates, (3) Automatically clean up old backups to save space, (4) Create backup strategies for configuration files, code repositories, or user data.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- cron-backup
- description
- Set up scheduled automated backups with version tracking and cleanup. Use when users need to (1) Schedule periodic backups of directories or files, (2) Monitor version changes and backup on updates, (3) Automatically clean up old backups to save space, (4) Create backup strategies for configuration files, code repositories, or user data.
03 SKILL.md 正文
Cron Backup
Automated backup scheduling with version detection and intelligent cleanup.
Quick Start
One-Time Backup
# Backup a directory with timestamp
./scripts/backup.sh /path/to/source /path/to/backup/dir
# Backup with custom name
./scripts/backup.sh /path/to/source /path/to/backup/dir my-backup
Schedule Daily Backup
# Set up daily backup at 2 AM
./scripts/setup-cron.sh daily /path/to/source /path/to/backup/dir "0 2 * * *"
Version-Aware Backup
# Backup only when version changes
./scripts/backup-versioned.sh /path/to/source /path/to/version/file /path/to/backup/dir
Cleanup Old Backups
# Keep only last 7 days of backups
./scripts/cleanup.sh /path/to/backup/dir 7
Core Capabilities
1. Directory Backup
- Creates timestamped tar.gz archives
- Preserves file permissions and structure
- Excludes common temp files (node_modules, .git, etc.)
2. Version-Triggered Backup
- Monitors version file or command output
- Backs up only when version changes
- Useful for software updates
3. Scheduled Execution
- Integrates with system cron
- Supports custom schedules
- Logs execution results
4. Automatic Cleanup
- Deletes backups older than N days
- Keeps minimum number of backups
- Prevents disk space exhaustion
Scripts
All scripts are in scripts/ directory:
backup.sh- Single backup executionbackup-versioned.sh- Version-triggered backupsetup-cron.sh- Cron job setupcleanup.sh- Old backup cleanuplist-backups.sh- List available backups
Backup Naming Convention
Backups follow the pattern: {name}_YYYYMMDD_HHMMSS.tar.gz
Examples:
openclabak_20260204_101500.tar.gzmyapp_20260204_000000.tar.gz
Workflow
Setting Up Automated Backups
-
Decide backup strategy
- What to backup (source directory)
- Where to store (backup directory)
- How often (schedule)
- Retention policy (cleanup days)
-
Run initial backup
./scripts/backup.sh /source /backup -
Set up schedule
./scripts/setup-cron.sh daily /source /backup "0 2 * * *" -
Configure cleanup
./scripts/setup-cron.sh cleanup /backup "" "0 3 * * *" 7
Version-Aware Backup Workflow
For software that changes version (like OpenClaw):
-
Identify version source
- Command:
openclaw --version - File:
/path/to/version.txt
- Command:
-
Set up versioned backup
./scripts/backup-versioned.sh /app /app/version.txt /backups/app -
Schedule version check
./scripts/setup-cron.sh versioned /app /backups/app "0 */6 * * *"
Common Patterns
Pattern 1: Daily User Data Backup
# Backup workspace daily, keep 30 days
./scripts/setup-cron.sh daily /home/user/workspace /backups/workspace "0 2 * * *"
./scripts/setup-cron.sh cleanup /backups/workspace "" "0 3 * * *" 30
Pattern 2: Version-Aware Application Backup
# Backup when application updates
./scripts/setup-cron.sh versioned /opt/myapp /backups/myapp "0 */6 * * *"
./scripts/setup-cron.sh cleanup /backups/myapp "" "0 4 * * 0" 10
Pattern 3: Multi-Directory Backup
# Backup multiple directories
./scripts/backup.sh /home/user/.config /backups/config
./scripts/backup.sh /home/user/projects /backups/projects
Cron Schedule Format
Standard cron format: minute hour day month weekday
Common schedules:
- Daily at 2 AM:
0 2 * * * - Every 6 hours:
0 */6 * * * - Weekly on Sunday:
0 0 * * 0 - Every 30 minutes:
*/30 * * * *
Cleanup Policies
- Time-based: Keep backups for N days
- Count-based: Keep last N backups
- Combined: Default keeps 7 days minimum, but at least 3 backups
Troubleshooting
- Permission denied: Ensure scripts are executable (
chmod +x scripts/*.sh) - Cron not running: Check cron service status (
systemctl status cron) - Disk full: Run cleanup manually or reduce retention period
- Backup fails: Check source directory exists and is readable
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.