#!/bin/ksh # script to delete the previous month from the loghist # directory on the network # ray 11-97 # to be run from cron # get the last month number zero=0 month=`date +%m` if [ $month == 1 ] then #jan, do dec prevmo=12 else prevmo=`expr $month - 1` fi # add the 0 if [ "$prevmo" -le 9 ] then prevmo=$zero"$prevmo" fi # now purge previous month from network ftp -v atlas << EOF cd /sys/factedi/log/loghist delete $prevmo*.lo? cd /sys/titanedi delete $prevmo*.lo? quit EOF