Git Workspace Backup for Openclaw

A specialized automation skill for scheduling directory backups to remote Git repositories using cron or launchd.

cooperun
v1.0.0
Mar 6, 2026
1
873
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install workspace-git-backup

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install workspace-git-backup using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Git Workspace Backup?

The Git Workspace Backup skill is designed to provide developers with a fail-safe mechanism for their local data. By integrating with Openclaw Skills, this tool automates the repetitive task of staging, committing, and pushing local changes to a remote repository like GitHub or GitLab. It is particularly useful for maintaining a versioned history of workspace configurations and project files without manual intervention.

This skill bridges the gap between local development and cloud redundancy. It handles the complexities of system-level scheduling, whether you are on macOS using launchd or Linux using cron. With native support for the GitHub CLI, it simplifies the initial repository setup, making it an essential addition to any developer's Openclaw Skills library.

Git Workspace Backup Use Cases

  • Automatically backing up your Openclaw workspace directory to a private GitHub repository twice daily.
  • Synchronizing essential configuration files across different development machines via a central Git remote.
  • Ensuring project snapshots are taken consistently before and after working hours.
  • Managing automated off-site backups for self-hosted scripts and local data folders.

How Git Workspace Backup Works

  1. The user identifies the target directory for backup, usually the Openclaw workspace.
  2. The skill configures a remote Git repository, either by creating a new one via the gh CLI or linking an existing URL.
  3. A configuration file is generated at ~/.openclaw/workspace/.backup-config.json to define paths and schedules.
  4. The backup execution script is installed to the local environment and made executable.
  5. The skill registers a background task (launchd for macOS or cron for Linux) to trigger the script at defined intervals.
  6. During execution, the script checks for file changes, optionally updates a README timestamp, and pushes the delta to the remote server.

Git Workspace Backup Setup

Prerequisites

Ensure you have git installed. For the best experience, install and authenticate the GitHub CLI (gh).

Installation Steps

# 1. Create the configuration file
cat > ~/.openclaw/workspace/.backup-config.json << 'EOF'
{
  "backupPath": "~/.openclaw/workspace",
  "gitRemote": "<your-repo-url>",
  "schedule": "0 12,0 * * *",
  "updateTimestamp": true
}
EOF

# 2. Deploy the backup script
mkdir -p ~/.openclaw/scripts
cp <skill-path>/scripts/backup.sh ~/.openclaw/scripts/github-backup.sh
chmod +x ~/.openclaw/scripts/github-backup.sh

# 3. Enable the schedule (macOS example)
bash <skill-path>/scripts/install-launchd.sh

Git Workspace Backup Data Schema & Taxonomy

The skill manages its operations through a specific file structure and configuration schema to ensure reliability within Openclaw Skills.

File Type Location Purpose
Configuration ~/.openclaw/workspace/.backup-config.json Stores the remote URL, backup path, and cron schedule.
Execution Script ~/.openclaw/scripts/github-backup.sh Logic for checking changes and performing git pushes.
Logging ~/.openclaw/logs/github-backup.log Tracks execution history and error reports.
System Agent ~/Library/LaunchAgents/com.openclaw.github-backup.plist macOS specific task runner definition.

Git Workspace Backup Advanced Features

  • Seamless integration with GitHub CLI for automated private repository creation.
  • Conditional execution logic that only commits and pushes when actual file changes are detected.
  • Optional timestamp injection to force backups even when primary data remains static.
  • Built-in management utilities for checking backup status, viewing logs, or uninstalling tasks.
  • Cross-platform compatibility for both macOS launchd and standard Linux cron jobs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*