Skip to content

Commit

Permalink
only scale DAYS_TO_CLEAN by usage if percentage exceeds 75
Browse files Browse the repository at this point in the history
  • Loading branch information
fordmcdonald committed Apr 18, 2024
1 parent a1ebe33 commit 6feb7e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ df -h /$PARENT_PATH/cache | while IFS= read -r line; do
if [ $counter -eq 2 ]; then
usage=$(echo "$line" | awk '{print $5}')
usage=${usage%\%}
DAYS_TO_CLEAN=$((DAYS_TO_CLEAN / usage))
if [ $usage -gt 75]; then
DAYS_TO_CLEAN=$((DAYS_TO_CLEAN / usage))
fi
fi
done

Expand Down

0 comments on commit 6feb7e6

Please sign in to comment.