DataGrab-import.log Rotation
#!/usr/bin/env bash
set -euo pipefail
# Path to the log file you rotate
LOG_FILE="cache/DataGrab-import.log"
# Directory where the logs live
LOG_DIR=$(dirname "$LOG_FILE")
# The base name of the log (without directory)
LOG_BASE=$(basename "$LOG_FILE")
# Delete rotated logs (with timestamp suffix) older than 7 days
find "$LOG_DIR" -type f -name "${LOG_BASE}.*" -mtime +7 -print -delete
0 * * * * /path/to/system/user/cleanup-log.shLast updated