# Log rotation for ActivityWatch services
# Place in /etc/logrotate.d/

/var/log/activitywatch/*.log {
    daily
    missingok
    rotate 30
    compress
    delaycompress
    notifempty
    create 644 activitywatch activitywatch
    postrotate
        systemctl reload activitywatch-server >/dev/null 2>&1 || true
        systemctl reload aw-worktime-api >/dev/null 2>&1 || true
    endscript
}

/var/log/journal/*activitywatch*.journal {
    daily
    missingok
    rotate 7
    compress
    delaycompress
    notifempty
    postrotate
        systemctl restart systemd-journald >/dev/null 2>&1 || true
    endscript
}