#!/bin/sh #====================================================================== # Copyright: (c) 2000 Paul Wilson # Name: Perf.sh # Author: hooker # Project: Performance measurement # Parameters: # None. # Description: # Run vmstat for an hour at 2 minute intervals. # # It assumes that the script and data both live in /home/Performance. # To use this properly, add a crontab entry which looks like : # # 0 * * * * /home/Performance/bin/Perf.sh # # i.e. start on the hour, every hour. The script itself runs for an hour. # You'll see one file per hour in the data directory for the full month, # a new directory automatically being created at the start of the new month. # Maintenance: # 200004xx 0.1 hooker Initial release #====================================================================== Dir=/home/Performance/data/`date +%Y%m` if [ ! -d "${Dir}" ];then mkdir -p ${Dir} fi Prefix=${Dir}/vm- PFile=${Prefix}`date +%Y%m%d_%H` Interval=30 Count=$(( 3600 / ${Interval} )) 2>/dev/null /usr/bin/vmstat ${Interval} ${Count} > ${PFile}