Files
Homelab/scripts/prune_ai_models.sh

19 lines
487 B
Bash
Executable File

#!/bin/bash
# prune_ai_models.sh - Remove AI model files older than 30 days to free space
# Adjust the MODEL_DIR path to where your AI models are stored (e.g., /mnt/nas/models)
set -euo pipefail
MODEL_DIR="/mnt/nas/models"
DAYS=30
if [[ ! -d "$MODEL_DIR" ]]; then
echo "Model directory $MODEL_DIR does not exist. Exiting."
exit 1
fi
echo "Pruning model files in $MODEL_DIR older than $DAYS days..."
find "$MODEL_DIR" -type f -mtime +$DAYS -print -delete
echo "Prune completed."