#!/bin/bash
cd pool
if [ $( find -maxdepth 1 | grep -cv '^\.$' ) -gt 50 ]; then
"Pool >= " find -maxdepth " - check for flooding!" | mail -s "Server Flooding Notice"
me@my.net
fi
I am trying to write a script that will alert me if a directory get too many files therein. I want the script to send the
find -maxdepth 1 | grep -cv '^\.$'
info placed between the text in quotes.
Thanks.