AI Newsletter Digest improvements: fixed QP soft line break decoding, URL extraction, and content cleaning
This commit is contained in:
27
skills/openclaw-self-healing/scripts/memory-cleanup.sh
Normal file
27
skills/openclaw-self-healing/scripts/memory-cleanup.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Memory Cleanup: Archive old daily logs to MEMORY.md
|
||||
# Runs weekly (Monday 03:30 KST)
|
||||
|
||||
set -e
|
||||
|
||||
WORKSPACE="$HOME/openclaw"
|
||||
MEMORY_DIR="$WORKSPACE/memory"
|
||||
MEMORY_FILE="$MEMORY_DIR/MEMORY.md"
|
||||
ARCHIVE_DIR="$MEMORY_DIR/archive"
|
||||
CUTOFF_DAYS=14
|
||||
|
||||
# Create archive directory if needed
|
||||
mkdir -p "$ARCHIVE_DIR"
|
||||
|
||||
# Find daily logs older than CUTOFF_DAYS
|
||||
find "$MEMORY_DIR" -name "2026-*.md" -type f -mtime +$CUTOFF_DAYS | while read -r file; do
|
||||
filename=$(basename "$file")
|
||||
echo "📦 Archiving: $filename"
|
||||
|
||||
# Move to archive
|
||||
mv "$file" "$ARCHIVE_DIR/"
|
||||
|
||||
echo "✅ Archived to archive/$filename"
|
||||
done
|
||||
|
||||
echo "🧹 Memory cleanup finished"
|
||||
Reference in New Issue
Block a user