You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
501 B

#!/bin/bash
# Nightly cleanup for ChatHub
# Backups chat history, clears log, removes old uploads
# Called by cron at 03:00 daily
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LOG_FILE="${SCRIPT_DIR}/nightly_cleanup.log"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting nightly cleanup..." >> "$LOG_FILE"
# Call the API endpoint
curl -s -X POST http://localhost:8202/api/nightly-cleanup >> "$LOG_FILE" 2>&1
echo "" >> "$LOG_FILE"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Cleanup completed." >> "$LOG_FILE"