Initial commit: homelab configuration and documentation
This commit is contained in:
18
scripts/prune_ai_models.sh
Executable file
18
scripts/prune_ai_models.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/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."
|
||||
Reference in New Issue
Block a user