#!/bin/bash THRESHOLD=90 df -PkH | grep '/opt/backups' | awk '{ print $5 " " $6 }' | while read output; do usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{print $2}' ) if [ $usep -ge $THRESHOLD ]; then echo "Backup volume \"$partition ($usep%)\" on $(hostname) at $(date)" | mail -s "ACTION REQUIRED: Backup volume usage at $usep%" infra-root@openstack.org fi done