#!/bin/sh # Rotate ezproxy Log file # dat=`date '+%y%m%d'` # # copy to tmp file echo "copying log file" cp -p ezproxy.log tmp.log # empty the log file > ezproxy.log # # record when this script run echo $dat >> rotatelog.log date >> rotatelog.log # ip to hostnames echo "converting ip to hostnames" ./ip2host < tmp.log > $dat.log # zip up old log echo "gziping..." gzip $dat.log echo "delete tmp.log" rm tmp.log echo "done" echo ""