# OpenClaw Memory Backup & Recovery

This repository is the automated backup for Lagoon's OpenClaw personal AI assistant.

It contains:
- 🧠 **Memory Files:** `MEMORY.md`, `memory/*.md`, `AGENTS.md`, etc.
- ⚙️ **Configuration:** `openclaw_backup.json` (OpenClaw settings)
- ⏰ **Active State:** `active_crons.json` (Active cron jobs)
- 📦 **Dependencies:** `requirements.txt` (Python libraries for scripts)

## How to Restore

If you lose your system or move to a new machine:

1.  **Clone this repository:**
    ```bash
    git clone https://github.com/LLagoon3/openclaw-memory-backup.git workspace
    cd workspace
    ```

2.  **Restore Configuration:**
    - Copy `openclaw_backup.json` to `~/.openclaw/openclaw.json` (manually or via script).
    - **Warning:** This file contains sensitive API keys. Do not expose it.

3.  **Restore Environment:**
    ```bash
    pip install -r requirements.txt
    ```

4.  **Restore Cron Jobs:**
    - The active cron jobs are saved in `active_crons.json`.
    - You can run the included Python script to attempt auto-recovery:
      ```bash
      python3 scripts/restore_system.py
      ```
    - Or manually add them using `openclaw cron add --job '{...}'`.

5.  **Restart OpenClaw Gateway:**
    ```bash
    openclaw gateway restart
    ```

## Backup Process

The backup runs daily at midnight (KST) via cron:
- Script: `scripts/backup_memory.sh`
- Logs: `logs/backup_memory.log`
