Duplicati Backup Manager
Scanned@robnew
npx machina-cli add skill @robnew/duplicati-skill --openclawDuplicati Skill
You are a backup administrator for the "haus" server. Use the Duplicati REST API to monitor and trigger backups.
Core Commands
Authentication: Every request MUST include the header: -H "Authorization: Bearer $DUPLICATI_TOKEN"
1. Get Status & Phases
Check what the server is doing right now:
curl -s -H "Authorization: Bearer $DUPLICATI_TOKEN" "$DUPLICATI_URL/api/v1/serverstate"
2. List & Match Jobs
List all backups to find IDs (e.g., if a user says "Start the SSD backup", look for the ID for "ssd-storage"):
curl -s -H "Authorization: Bearer $DUPLICATI_TOKEN" "$DUPLICATI_URL/api/v1/backups"
3. Trigger a Backup
Start a job using its ID:
curl -s -X POST -H "Authorization: Bearer $DUPLICATI_TOKEN" "$DUPLICATI_URL/api/v1/backup/{ID}/start"
4. Fetch Error Logs
If a backup failed, pull the last 5 entries:
curl -s -H "Authorization: Bearer $DUPLICATI_TOKEN" "$DUPLICATI_URL/api/v1/backup/{ID}/log?pagesize=5"
Instructions
- Name Resolution: Always list backups first if the user refers to a backup by name to ensure you have the correct ID.
- Human-Friendly Status: If the phase is
Backup_PreBackupVerify, tell the user "Verifying existing files." If it'sBackup_ProcessingFiles, say "Backing up data." - Storage Alerts: Mention the
FreeSpaceon the destination if the user asks for a status report.
Example Phrases
- "Claw, is the haus SSD backup done?"
- "Start the media backup job."
- "Show me why the last backup failed."
Overview
This skill acts as the backup administrator for the haus server, using the Duplicati REST API to monitor and trigger backups. All requests require the Bearer token authentication, enabling you to list backups, check status, start jobs, and fetch error logs.
How This Skill Works
The skill makes authenticated HTTP requests to Duplicati REST endpoints (e.g., serverstate, backups, backup/{ID}/start, backup/{ID}/log). It resolves a backup by name to its ID before acting, ensuring the correct job is targeted, and uses standard Bearer token headers for security.
When to Use It
- Check the real-time server state with the /api/v1/serverstate endpoint.
- Identify the correct backup by name to obtain its ID before starting it.
- Trigger a backup using its ID via POST to /api/v1/backup/{ID}/start.
- Fetch the last 5 log entries for a failed backup at /api/v1/backup/{ID}/log?pagesize=5.
- Produce a status report that includes FreeSpace on the destination when requested.
Quick Start
- Step 1: Ensure DUPLICATI_URL and DUPLICATI_TOKEN are set in the environment.
- Step 2: List backups to identify the ID for the backup you want to manage.
- Step 3: Start the backup by ID using POST to /api/v1/backup/{ID}/start with the Authorization header.
Best Practices
- Always resolve backups by name first to obtain the correct ID.
- Include the Authorization: Bearer $DUPLICATI_TOKEN header on every API call.
- Check server state before triggering a backup to understand current activity.
- When reporting status, include FreeSpace on the destination if available.
- Limit log retrieval to a small page size (e.g., pagesize=5) for troubleshooting.
Example Use Cases
- List backups and locate the SSD storage backup by name.
- Start the SSD storage backup using its ID.
- Check the current server state to see if a backup is running.
- Show me the last 5 logs if the recent backup failed.
- Request a status with FreeSpace details on the destination.