in reply to Re: Simple Log Rotate Problem
in thread Simple Log Rotate Problem

I prefer to cp/truncate instead of deleting. That way you do not have to worry about restarting the service that has the file open for logdumping. on commandline it looks like this:
rm logfile.5 mv logfile.4 logfile.5 mv logfile.3 logfile.4 mv logfile.2 logfile.3 mv logfile.1 logfile.2 cp logfile logfile.1 cat /dev/null > logfile
its about the same thing in perl except you use File::Copy's copy and move and open OUTFILE, ">logfile"; close OUTFILE; to truncate


-Waswas