Adjust LIMIT & SLEEP_TIME to suite your purpose

发表于:2007-05-26来源:作者:点击数: 标签:

#!/bin/ksh

PS_LOG=
# Adjust LIMIT & SLEEP_TIME to suite your purpose/need.
# There are 288 5 minute intervals in 1 day
LIMIT=500

#!/bin/ksh

PS_LOG=
# Adjust LIMIT & SLEEP_TIME to suite your purpose/need.
# There are 288 5 minute intervals in 1 day
LIMIT=500

#sleep for 5 minutes
SLEEP_TIME=300
while true
do
  i=0
  echo >$PS_LOG
  while [ "$i" -le $LIMIT ]
  do
    date >>$PS_LOG
    ps avwwwg >>$PS_LOG
    echo >>$PS_LOG
    i=`expr $i + 1`
    sleep $SLEEP_TIME
  done
done

原文转自:http://www.ltesting.net