---
name: "backup-inbound-images"
description: "Kopiert Bilder aus inbound/ nach persistent-inbound/"
---

# Backup Inbound Images

## Purpose
Sichert alle Bilddateien aus `/root/.openclaw/media/inbound/` nach `/root/.openclaw/media/persistent-inbound/`.

## Prerequisites
- Quelle: `/root/.openclaw/media/inbound/` muss existieren
- Ziel: `/root/.openclaw/media/persistent-inbound/` wird falls nicht vorhanden erstellt

## Procedure
```bash
# Verzeichnis prüfen
if [ ! -d "/root/.openclaw/media/inbound" ]; then
  echo "SKIP: inbound directory does not exist"
  exit 0
fi

# Dateien zählen
count=$(find /root/.openclaw/media/inbound/ -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.webp' -o -iname '*.bmp' -o -iname '*.svg' \) 2>/dev/null | wc -l)

if [ "$count" -eq 0 ]; then
  echo "SKIP: no image files found in inbound"
  exit 0
fi

# Zielverzeichnis erstellen
mkdir -p /root/.openclaw/media/persistent-inbound/

# Kopieren
cp /root/.openclaw/media/inbound/*.png /root/.openclaw/media/persistent-inbound/ 2>/dev/null
cp /root/.openclaw/media/inbound/*.jpg /root/.openclaw/media/persistent-inbound/ 2>/dev/null
cp /root/.openclaw/media/inbound/*.jpeg /root/.openclaw/media/persistent-inbound/ 2>/dev/null
cp /root/.openclaw/media/inbound/*.gif /root/.openclaw/media/persistent-inbound/ 2>/dev/null
cp /root/.openclaw/media/inbound/*.webp /root/.openclaw/media/persistent-inbound/ 2>/dev/null
cp /root/.openclaw/media/inbound/*.bmp /root/.openclaw/media/persistent-inbound/ 2>/dev/null
cp /root/.openclaw/media/inbound/*.svg /root/.openclaw/media/persistent-inbound/ 2>/dev/null

echo "BACKUP_OK: $count files copied to persistent-inbound"
```
