How can I rotate the Apache Access and Error logs on a Window 2000 box?
I include my batch file below as an answer.
Is there a way of doing this directly via the Apache config file? I’m currently using the following customlog command to generate daily logs.
CustomLog ‘|’ ‘*Apache-Path/bin/rotatelogs.exe’ ‘*Apache-Path/logs/backup/internet_access_%d-%m-%y.log’ 86400′ combined
Here’s the DOS batch file, modified as annotated. I run it weekly and it keeps 8 weeks of zipped backups. You’ll need to install 7 zip.
I haven’t parametrised the paths, feel free to.