The performance archives managed by the pmlogger utility may
benefit from some period management tasks, run as root
by cron.
The check task periodically interrogates all
configured pmlogger instances and restarts any that are not
currently running.
The archive management task is run once a day
to start a new archive for each configured pmlogger instance
and to cull old archives.
Display man pages:
cron.pmcheck,
cron.pmdaily.
End-of-File
_postscript
}
# mainline
#
_form
_decode_params check daily keep action
if [ "$action" = "Cancel" ]
then
echo "Location: webmeter0.cgi"
echo
exit
fi
if [ "$action" = Help ]
then
echo "Location: http://$SERVER_NAME:$SERVER_PORT/pcpweb/custom.html#Sample-cron-scripts"
echo
exit
fi
[ "$action" = Defaults ] && _default
# Ok or defaults or \n in last input widget
echo 'g/cron.pmcheck/d' >$tmp.cmd
echo 'g/cron.pmdaily/d' >>$tmp.cmd
rm -f $tmp.tmp; touch $tmp.tmp
$check && echo "25,55 * * * * /usr/pcp/pmlogger/cron.pmcheck" >>$tmp.tmp
if $daily
then
if [ "X$keep" = X ]
then
_yywarn "Keep must be non-blank to enable the daily archive management task." "$MYTITLE"
exit
fi
if echo "$keep" | grep '[^0-9]' >/dev/null
then
_yywarn "Keep must be numeric and non-negative to enable the daily archive management task." "$MYTITLE"
exit
fi
echo "10 0 * * * /usr/pcp/pmlogger/cron.pmdaily -k $keep" >>$tmp.tmp
fi
if [ -s $tmp.tmp ]
then
echo '$a' >>$tmp.cmd
cat $tmp.tmp >>$tmp.cmd
echo '.' >>$tmp.cmd
fi
echo w >>$tmp.cmd
echo q >>$tmp.cmd
ex - $CRONTAB <$tmp.cmd
killall -HUP cron
exec `pwd`/webmeter6.cgi