#!/bin/bash dir=/loc_data if [ "$HOSTNAME" == "daq" ] then dir=/raid10 fi diskusage=( `df -P $dir | grep $dir ` ) # check if more than X GB are left on /loc_data if [ ${diskusage[3]} -lt 209715200 ] # 200 GB #if [ ${diskusage[3]} -lt 104857600 ] # 100 GB then echo "WARN less than 200 GB left on /loc_data on node "$HOSTNAME df -h $dir fi