#!/bin/sh set -eu TARGET_DIR="${TMP_ARCHIVE_DIR:-/tmp/erp-generated-archives}" RETENTION_DAYS="${TMP_RETENTION_DAYS:-1}" if [ ! -d "$TARGET_DIR" ]; then exit 0 fi find "$TARGET_DIR" -type f -name '*.zip' -mtime +"$RETENTION_DAYS" -delete find "$TARGET_DIR" -type d -empty -delete