#!/bin/bash
DATE=$(date +%Y-%m-%d)
LOG=/var/log/peercortex/audit-${DATE}.log
find /var/log/peercortex/ -name 'audit-*.log' -mtime +30 -delete 2>/dev/null
find /var/log/peercortex/ -name 'audit-*.json' -mtime +30 -delete 2>/dev/null
python3 /opt/peercortex-app/audit/rotating_audit.py > "$LOG" 2>&1
