#!/bin/bash # mem0 backup script set -euo pipefail MEMORY_DIR="/Users/aodhan/.openclaw/memory/" # Check if directory exists if [[ ! -d "$MEMORY_DIR" ]]; then echo "Error: Memory directory $MEMORY_DIR does not exist" >&2 exit 1 fi cd "$MEMORY_DIR" # Check if git is initialized if [[ ! -d ".git" ]]; then echo "Error: Git not initialized in $MEMORY_DIR" >&2 exit 1 fi # Check if there are changes to commit if git diff --cached --quiet && git diff --quiet; then echo "No changes to commit" exit 0 fi git add . git commit -m "mem0 backup $(date)" || echo "Nothing to commit" # git push # Uncomment when remote is configured