DB Backup for Openclaw

Automate database backups and rotation for multiple engines using Openclaw Skills to ensure data integrity and storage efficiency.

sa9saq
v1.1.0
Feb 8, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install db-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 db-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 DB Backup?

This skill provides a streamlined approach to database maintenance by generating robust shell scripts for automated backups. It handles compression, retention policies, and scheduling, ensuring that your data remains safe while optimizing storage through automatic rotation of old archives.

Designed for developers and sysadmins, it integrates seamlessly into existing workflows using standard Unix tools. Utilizing Openclaw Skills for your database management allows you to standardize your data protection strategy across different engines including PostgreSQL, MySQL, and SQLite with minimal manual configuration.

DB Backup Use Cases

  • Scheduling nightly backups for production PostgreSQL or MySQL databases to prevent data loss.
  • Implementing automated data rotation to prevent disk space issues on self-hosted servers.
  • Creating point-in-time snapshots for SQLite application databases during development.
  • Integrating database backups with remote storage via tools like AWS S3 or rclone for off-site redundancy.

How DB Backup Works

  1. The user provides database credentials, target directory, and retention preferences.
  2. The skill generates a tailored shell script using specific utilities like pg_dump or mysqldump based on the engine.
  3. Hardened security permissions (chmod 700/600) are applied to the directory and dump files.
  4. A cron job is configured to automate the execution of the script at a specified frequency.
  5. The script automatically identifies and deletes expired backups based on the defined retention window.

DB Backup Setup

Ensure that the necessary database client tools (e.g., postgresql-client, mysql-client) are installed. After generating the script, use the following commands to initialize the automation:

# Make the generated script executable
chmod +x backup.sh

# Register the script with crontab for daily execution at 2 AM
(crontab -l 2>/dev/null; echo "0 2 * * * /path/to/backup.sh >> /path/to/backup.log 2>&1") | crontab -

Important: To maintain security within Openclaw Skills workflows, avoid hardcoding passwords; use credential files like ~/.pgpass or ~/.my.cnf.

DB Backup Data Schema & Taxonomy

The skill organizes backups in a structured directory format to simplify retrieval and management.

Attribute Description
Root Directory Default: ~/backups/db/ (Customizable)
Naming Convention {DATABASE_NAME}_{TIMESTAMP}.{EXTENSION}
Compression Gzip compression used for MySQL and SQLite
Permissions Directory: 700 (Owner Only), Files: 600 (Read/Write Only)
Log Schema Standardized timestamps with success/error status messages

DB Backup Advanced Features

  • Multi-engine support including PostgreSQL, MySQL, SQLite, and MongoDB.
  • Intelligent rotation logic using the find command to purge files older than X days.
  • Piped output support for streaming backups directly to cloud storage providers.
  • Atomic SQLite backups using the .backup command to ensure consistency without locking the database.
  • Customizable scheduling via standard crontab syntax for flexible frequency control.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*