bramhacharimogudu Posted April 14, 2018 Report Posted April 14, 2018 Disk quota monitoring ki automation script raayaali..? konchem help cheyyandi Quote
HorseTheGurram Posted April 14, 2018 Report Posted April 14, 2018 #!/bin/sh df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge 90 ]; then echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" | mail -s "Alert: Almost out of disk space $usep%" [email protected] fi done Quote
bramhacharimogudu Posted April 14, 2018 Author Report Posted April 14, 2018 1 hour ago, HorseTheGurram said: #!/bin/sh df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge 90 ]; then echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" | mail -s "Alert: Almost out of disk space $usep%" [email protected] fi done Thanks Bro Quote
AlaElaAlaEla Posted April 14, 2018 Report Posted April 14, 2018 39 minutes ago, bramhacharimogudu said: Thanks Bro Quote
jpismahatma Posted April 14, 2018 Report Posted April 14, 2018 Why can’t you even do google ani @tom bhayya ... abhpiprayam... Quote
bramhacharimogudu Posted April 14, 2018 Author Report Posted April 14, 2018 6 hours ago, HorseTheGurram said: #!/bin/sh df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge 90 ]; then echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" | mail -s "Alert: Almost out of disk space $usep%" [email protected] fi done This one works for filesystem there are 2 user ids under one group and those 2 using space from same bucket My requirement is for userID i am using /usr/lpp/mmfs/bin/mmlsquota -g $(id -ng) user1 and user2 sharing 1 tb user1 using 500 gb and user 2 using 500 gb nenu raasina script user1 500 gb used out of 1 tb kabatti 50% free annatlu chupistundi which is not true deeniki solution cheppandi which command is better Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.