#!/bin/sh # # Run logrotate once a day against the bind-mounted config. `|| true` so a # transient error (e.g. a log file mid-rename) doesn't kill the container. # set -eu CONF=/etc/logrotate.d/lacuna STATE=/var/lib/logrotate/lacuna.status mkdir -p /var/lib/logrotate while true; do echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') running logrotate" logrotate -v -s "$STATE" "$CONF" || true sleep 86400 done