Results 1 to 2 of 2
Hi All,
Can anyone help with this? Basically, we want to run a command in the cron that checks the amount of domains on a server, and sends a warning ...
- 06-12-2008 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 1
Script Help Rqd - Warning mail when wc -l /etc/localdomains is more than 100?
Hi All,
Can anyone help with this? Basically, we want to run a command in the cron that checks the amount of domains on a server, and sends a warning mail to an Email address if that number is, say, above 100.
We can get the number of domains with:
wc -l /etc/localdomains
...but how to check if its more than 100 and only then send a warning mail?
Thank you for any help!
- 06-12-2008 #2
hi,
have you tried something like this
Code:#!/bin/bash LDOM=`wc -l /etc/localdomains | awk '{print $1}'` if [ $LDOM -gt 100 ] then # here you use mail for example to send the mail fiLinux and me it's a love story


Reply With Quote