SMF Works — AI Solutions for Small Business
← Back to all skills
Freeclaw-system-backup

Claw System Backup

Create compressed archives of your Linux system. Supports full system, incremental, or home-directory-only backups. Requires root access for full system backup. Automatic integrity verification and retention management.

Key Features

  • Full system, incremental, or home-only backups
  • Compressed archives (gzip/bzip2/xz)
  • Automatic integrity verification
  • 2-week rolling retention
  • Requires root for full system backup
  • No external APIs - fully local

Common Use Cases

  • Weekly system protection
  • Complete disaster recovery
  • Migrate to new hardware
  • System configuration backup

Custom Workflow Integration

This skill can be customized for your specific workflow as part of an SMF Works services engagement. Whether you need custom automation rules, integrations with your existing tools, or specialized configurations for your team, we can tailor this skill to fit your exact requirements.

Explore Services

Installation

# Install the skill (via TUI or CLI)

smfw install claw-system-backup

# Get help

smfw run claw-system-backup --help

💡 Tip: Install via the OpenClaw TUI skill manager for an interactive experience, or use the CLI command above.

Setup Guide

Claw System Backup — Setup Guide

Estimated setup time: 10 minutes
Difficulty: Easy
Tier: Pro — requires SMF Works Pro subscription ($19.99/mo)


What You'll Need

RequirementDetailsCost
SMF Works Pro subscriptionsmfworks.com/subscribe$19.99/mo
Python 3.8+Built into macOS 12+, available on LinuxFree
OpenClawInstalled and authenticatedFree
tarStandard on macOS and LinuxFree
Free disk spaceAt least 3× your home directory size
smfworks-skills repositoryCloned via gitIncluded

Step 1 — Subscribe and Authenticate

Visit smfworks.com/subscribe.

openclaw auth status

Expected: Your email and Pro tier shown.


Step 2 — Check Available Disk Space

df -h ~

You need at least 3× your home directory's current size for 3 rolling backups. Check your home directory size:

du -sh ~

Step 3 — Get the Repository

git clone https://github.com/smfworks/smfworks-skills ~/smfworks-skills

Step 4 — Configure the Skill

cd ~/smfworks-skills/skills/claw-system-backup
python3 main.py --configure

Configuration prompts:

Source directory [~]: 
Backup directory [~/.smf/backups]: 
Retention count (number of backups to keep) [3]: 
Additional directories to exclude (comma-separated): 

✅ Configuration saved!

Accept defaults or customize. If you want to back up to an external drive, enter its path as the backup directory.


Step 5 — First Backup

python3 main.py

The first backup may take several minutes depending on your home directory size.

Expected output:

💾 Creating system backup...
✅ Backup complete!
   Archive size: 4.82 GB
   Retention: Kept last 3 backups

Step 6 — Verify the Backup

python3 main.py --list

You should see the backup listed with size and timestamp.

Optionally verify integrity:

python3 main.py --verify /path/to/backup.tar.gz

Configuration File

~/.config/smf/skills/claw-system-backup/config.json

Default exclusions (to reduce backup size):

  • .cache/
  • __pycache__/
  • node_modules/
  • .git/

Set Up Automatic Weekly Backups

crontab -e

Add (Sunday at 2 AM):

0 2 * * 0 python3 /home/yourname/smfworks-skills/skills/claw-system-backup/main.py >> /home/yourname/logs/system-backup.log 2>&1
mkdir -p ~/logs

Troubleshooting

Error: SMF Works Pro subscription required — Subscribe at smfworks.com/subscribe.

Backup takes too long — Add large directories to the exclusion list in config. Common candidates: ~/Downloads, ~/Videos, ~/.local/share.

Disk space error — Free up space or configure backup directory to a larger drive.

tar: command not found — Install tar: sudo apt install tar (Ubuntu/Debian).


Next Steps

Setup complete. See HOWTO.md for backup, verify, restore, and automation walkthroughs.

How-To Guide

Claw System Backup — How-To Guide

Prerequisites: SMF Works Pro subscription active. Setup complete (see SETUP.md).


Table of Contents

  1. How to Create a Full System Backup
  2. How to List and Verify Your Backups
  3. How to Restore from a Backup
  4. How to Restore a Single File
  5. How to Reduce Backup Size with Exclusions
  6. Automating with Cron
  7. Combining with Other Skills
  8. Troubleshooting Common Issues
  9. Tips & Best Practices

1. How to Create a Full System Backup

What this does: Creates a compressed .tar.gz archive of your configured source directory (default: home directory).

cd ~/smfworks-skills/skills/claw-system-backup
python3 main.py

Output:

💾 Creating system backup...

Source: /home/user
Archive: /home/user/.smf/backups/system-2024-03-15-090001.tar.gz
Excluding: .cache, __pycache__, node_modules

Progress: ████████████████████ 100%

✅ Backup complete!
   Archive size: 4.82 GB
   Files backed up: 47,382
   Time taken: 3m 42s

2. How to List and Verify Your Backups

List backups:

python3 main.py --list

Verify integrity of the latest backup:

python3 main.py --verify ~/.smf/backups/system-2024-03-15-090001.tar.gz

Output:

🔍 Verifying backup: system-2024-03-15-090001.tar.gz
   Testing archive integrity...
   ✅ Archive is valid — 47,382 files verified

Why verify? A backup that can't be restored is useless. Verification catches corrupted archives before you need them.


3. How to Restore from a Backup

⚠️ Warning: Restore overwrites files in your home directory with those from the backup. Back up your current state first if needed.

# Optional: create a backup of current state first
python3 main.py

# Then restore from desired backup
python3 main.py --restore ~/.smf/backups/system-2024-03-14-090001.tar.gz

4. How to Restore a Single File

For restoring one file without overwriting everything, use tar directly:

Step 1 — Find the file path inside the archive:

tar -tzf ~/.smf/backups/system-2024-03-14-090001.tar.gz | grep "important-document"

Output:

home/user/Documents/Projects/important-document.pdf

Step 2 — Extract just that file:

tar -xzf ~/.smf/backups/system-2024-03-14-090001.tar.gz -C /tmp/ home/user/Documents/Projects/important-document.pdf

Step 3 — Move it back:

mv /tmp/home/user/Documents/Projects/important-document.pdf ~/Documents/Projects/

5. How to Reduce Backup Size with Exclusions

When to use it: Your backup is taking too long or consuming too much disk space.

Step 1 — Find large directories:

python3 ~/smfworks-skills/skills/system-monitor/main.py large-files ~ 20

Step 2 — Add them to exclusions via configure.

python3 main.py --configure

At the exclusions prompt, add large directories you don't need backed up:

Additional directories to exclude: Downloads,Videos,VMs

Step 3 — Verify the next backup is smaller.

python3 main.py
python3 main.py --list

6. Automating with Cron

Open crontab

crontab -e

Example: Weekly backup every Sunday at 2 AM

0 2 * * 0 python3 /home/yourname/smfworks-skills/skills/claw-system-backup/main.py >> /home/yourname/logs/system-backup.log 2>&1

Example: Daily backup at 1 AM

0 1 * * * python3 /home/yourname/smfworks-skills/skills/claw-system-backup/main.py >> /home/yourname/logs/system-backup.log 2>&1

Cron Expression Reference

ExpressionMeaning
0 2 * * 0Sundays at 2 AM
0 1 * * *Every day at 1 AM
0 0 1 * *First day of each month at midnight

7. Combining with Other Skills

Claw System Backup + OpenClaw Backup: Double protection — system backup weekly, workspace backup daily:

# Daily workspace backup (crontab)
0 2 * * * python3 /home/yourname/smfworks-skills/skills/openclaw-backup/main.py >> ~/logs/workspace-backup.log 2>&1

# Weekly system backup (crontab)
0 1 * * 0 python3 /home/yourname/smfworks-skills/skills/claw-system-backup/main.py >> ~/logs/system-backup.log 2>&1

Claw System Backup + System Monitor: Check disk before backing up:

python3 ~/smfworks-skills/skills/system-monitor/main.py disk
python3 ~/smfworks-skills/skills/claw-system-backup/main.py

8. Troubleshooting Common Issues

Backup takes 30+ minutes

Your home directory is large, or includes large files.
Fix: Run du -sh ~/*/ to find the largest subdirectories, then add them to exclusions.

tar: Removing leading '/' from member names

This warning is normal — it means tar is creating a portable archive (without the leading /).

Backup interrupted (Ctrl+C or crash)

The partial .tar.gz file may be corrupt.
Fix: Delete the partial file and re-run. python3 main.py --list will show any zero-byte entries to clean up.

--verify reports archive invalid

The backup file is corrupted.
Fix: Delete it and create a new backup.


9. Tips & Best Practices

Back up to a different physical drive. The default is ~/.smf/backups on the same disk. If the disk fails, you lose both data and backup. Configure a separate drive or NAS as the backup destination.

Verify backups monthly. Run --verify on your latest backup once a month. Confirming the archive is valid is the only way to know you can actually restore when needed.

Adjust exclusions to balance size vs completeness. Downloads, videos, and node_modules are common size contributors that don't need backing up. Add them to exclusions to keep backups manageable.

Schedule backups during off-hours. Backups are I/O intensive. 1–3 AM minimizes impact on your work sessions.

Keep at least one backup off-site. Copy the most recent backup to an external drive or cloud storage periodically. Local-only backups don't protect against fire, theft, or flood.