Msg#: 3192201 posted 3:05 pm on Dec 18, 2006 (gmt 0)
A linux server running Apache 2.0.54
I have a server with many sites configured using Mass Virtual Hosting [httpd.apache.org] and apache2 is set to log to one single file (for all hosts) each day using the 'Combined' format (i.e. with the hostname at the start of each log entry), the file is called vhost.YYMMDD and is autogenerated each day.
Before processing, I need to split these logfiles using Apache's split-logfile [httpd.apache.org] command, is there an easy way to run this on every file in a folder?
Msg#: 3192201 posted 4:45 pm on Dec 18, 2006 (gmt 0)
You could write another script (or modify the script provided) to loop through any given directory. Or, another option might be to find and exec, something along the lines of ... find /var/log/apache2/vhost.* -exec split-logfile
Double check that syntax, at least you get an idea though.
You may want to ask this question in the *nix forum. There are some bright admins that hang out there that may have a better solution.