Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
Write an article for LinuxForums Today! Win Great Prizes!
This shell script checks the Mailbox size of user and if it is greater than the threshold limit, it will send a mail to user and System Admin for the further action. This may cron and may be generalized for all the users
#!/bin/bash #Script checks the Mailbox size of user and if it is greater than the threshold limit, it will send a mail to user and Admin. This may be cron.
#THRESHOLD is 1228800KB=1200MB
THRESHOLD=1228800
#awk print first column value, sed remove M from the output i.e. if it is 300M then it will display only 300. But some time size will be in GB so it will not work. Better display in default unit i.e. KB by removing -h (human). Now KB will not be displayed explicitly
#CURRENT=$(du -hs /home/USERID/Mailbox | awk '{print $1}' | sed 's/M//g')