dear all
i am using fedora 4 for bash scripting
i have a postfix mail server . my script run on this server
i want to make a sript which will manage server automatically
for this a make script which will mail me if queue greater the 500
as:
#!/bin/bash
qshape|head|grep TOTAL|awk '/.*/ {print $2}' >value
i=`cat value`
if [ "$i" -gt 500 ];
then
mail -s "`date` "
cs_dhiman@yahoo.co.in < output
cp /etc/postfix/main.cf.bk /etc/postfix/main.cf
postfix reload
fi
this works ok .
the cp line in script will place a file which has default_process limit as 25
now i want that after 5 min. the main.cf.ok will replace the main.cf
so that the default _process limit will become 700 .( as in normal mode)
Question is:
what type loop will help me to calculate 5 min time after the if condition comes true ...so that i can put the orignal file...