#!/bin/sh - # # @(#)monthly 5.5 (Berkeley) 6/17/91 # PATH=/bin:/usr/bin:/sbin:/usr/sbin host=`hostname -s` echo "Subject: $host monthly run output" W=/var/log/wtmp if [ -f $W ] ; then # Work out what month it was yesterday M=`date -v-1m +%h` mv -f $W $W.$M touch $W if [ -x /usr/sbin/ac ] ; then echo "" echo "Doing login accounting:" ac -p -w $W.$M | sort -nr +1 fi rm -f $W.$M.gz gzip $W.$M fi if [ -f /etc/monthly.local ]; then echo "" echo "Running monthly.local:" sh /etc/monthly.local fi