User Tools

Site Tools


execution_time_and_notify

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
execution_time_and_notify [2011/05/11 09:45]
k2patel
execution_time_and_notify [2011/05/25 14:51] (current)
k2patel
Line 4: Line 4:
 <code bash> <code bash>
 s=`date +%s`; /​usr/​local/​bin/​php index.php ; e=`date +%s`; if [ $(( $e - $s )) -gt 10 ]; s=`date +%s`; /​usr/​local/​bin/​php index.php ; e=`date +%s`; if [ $(( $e - $s )) -gt 10 ];
-then /​usr/​bin/​mail -s "[Degree] `hostname` Time is More then 10 second"​ status@k2.com ; fi+then /​usr/​bin/​mail -s "[Notice] `hostname` Time is More then 10 second"​ status@k2.com ; fi
 </​code>​ </​code>​
  
Line 19: Line 19:
 notify(){ notify(){
    for n in $receipients;​ do    for n in $receipients;​ do
-      echo $1 | /​usr/​bin/​mail -s "[Degree] `hostname` Time is More then 10 second"​ $n+      echo $1 | /​usr/​bin/​mail -s "[Notice] `hostname` Time is More then 10 second"​ $n
    done    done
 } }
execution_time_and_notify.txt ยท Last modified: 2011/05/25 14:51 by k2patel