On 22/10/2019 6:38 PM, Marc Roos via dovecot wrote:
> Ok, what about placing a dummy file of 5GB or so on the partition, that 
> you can remove when necessary?

I recently wrote a script to check disk space every week and email me an alert 
if there was less than 5G. Would that be an approach for you? Enclosing below 
as an example. You'd need to adapt to your own environment. 

#!/bin/bash

MAILSPACE=$( df -h | grep "/dev/sdd" | awk '{ print $4 }' | sed 's/G//g' )

if [ "$MAILSPACE" -lt "5" ] ; then
        MESSAGE="Alert, only $MAILSPACE Gb of space left on Mail Drive"
        df -h > /tmp/diskalert.txt
        mutt -s "$MESSAGE" m...@example.com < /tmp/diskalert.txt 
else
        # Uncomment to debug 
        MESSAGE="Safe for now: $MAILSPACE Gb of space left on Mail Drive"
        #echo $MESSAGE
fi


Reply via email to