1 Anonymous Asked: August 20, 2019In: Computer Science Write a shell script to check a proper utilization of disk space and send an email to the user currently logged in 1 1 Answer Voted Oldest Recent Best Answer admin Added an answer on June 23, 2020 at 10:27 am CURRENT=$(df / | grep / | awk ‘{ print $5}’ | sed ‘s/%//g’) THRESHOLD=90 if [ “$CURRENT” -gt “$THRESHOLD” ] ; then mail -s ‘Disk Space Alert’ [email protected] << EOF 0 Reply Share Share Share on Facebook Share on Twitter Share on LinkedIn Share on WhatsApp Leave an answerLeave an answerCancel reply Featured image Select file Browse Save my name, email, and website in this browser for the next time I comment.
CURRENT=$(df / | grep / | awk ‘{ print $5}’ | sed ‘s/%//g’)
THRESHOLD=90
if [ “$CURRENT” -gt “$THRESHOLD” ] ; then
mail -s ‘Disk Space Alert’ [email protected] << EOF