Aller au contenu

Archivage Telegram

Architecture (Option A)

L'archiveur lit directement les fichiers de sessions OpenClaw (.jsonl) sur le host, sans passer par l'API Telegram — pas de conflit de polling.

OpenClaw container
  └── sessions mc-orion → /docker/openclaw-nhcb/data/.openclaw/agents/mc-orion/sessions/*.jsonl
                          tg-archiver.service (host)
                          /docker/openclaw-nhcb/data/.openclaw/telegram-archive/updates.jsonl

Service

systemctl status tg-archiver.service
tail -f /docker/openclaw-nhcb/data/.openclaw/telegram-archive/updates.jsonl

Rotation (logrotate)

Config : /etc/logrotate.d/tg-archiver - Rotation quotidienne, 14 jours, compression gzip, copytruncate

Requêtes

# Tous les messages d'un groupe
tg-archive-query.py --chat -5133114258

# Recherche mot-clé, export CSV
tg-archive-query.py --contains "ping" --csv > /tmp/out.csv

# Filtrer par date
tg-archive-query.py --since 2026-03-09T08:00:00 --role user