# Rotate any log files Air (cast-server + wrapper scripts) write under
# /var/log/cast. The Rust service currently funnels structured logs to the
# SQLite `logs` table (surfaced by the System page at /api/system/logs) and
# lets env_logger send stderr to journald, so this directory is usually
# empty. It only matters when a sidecar wrapper (e.g. the air-zerotier /
# air-tailscale shell helpers, an admin-triggered backup, a debugging
# redirect) ends up dropping a `.log` file here.
#
# The rules below cap any such file at 10 MB with at most 3 compressed
# rollovers (≈30 MB worst-case on disk), run weekly, and `copytruncate` so
# we don't need SIGHUP plumbing — the writer can keep its existing fd and
# the old bytes just disappear. `missingok` + `notifempty` keep the cron
# job silent when there genuinely is nothing to rotate, which is the common
# case. Owner/group/mode match what install.sh and stage-cast set so
# logrotate (root) doesn't accidentally relax perms on the cast-owned dir.
/var/log/cast/*.log {
    size 10M
    rotate 3
    weekly
    compress
    delaycompress
    missingok
    notifempty
    copytruncate
    create 0640 cast cast
}
