User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2
Wolfram Stebel wrote:
Hi all,
on my xserve with 10.4 i have several websites running.
apache should log into /var/log/httpd/access.log and .../error.log.
/etc/weekly contains:
if sw_vers -productName|grep -vq Server; then
cd /var/log/httpd
for i in access_log error_log; do
if [ -f "${i}" ]; then
printf %s " $i"
if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}"
"${i}.4${gzext}"; fi
if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}"
"${i}.3${gzext}"; fi
if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}"
"${i}.2${gzext}"; fi
if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}"
"${i}.1${gzext}"; fi
if [ -f "${i}" ]; then mv -f "${i}" "${i}.0" && if [ -x
/usr/bin/gzip ]; then gzip -9 "${i}.0"; fi; fi
touch "${i}" && chmod 640 "${i}" && chown root:admin "${i}"
fi
done
if [ -f /var/run/httpd.pid ]; then /usr/sbin/apachectl restart; fi
echo ""
fi
to rotate the logs, but this code seems not to execute (the starting if
evaluates to "true").
If you mean "has a non zero return code" by "evaluates to true", then it
strictly speaking evaluates to false!
Above log rotating code is intended for a stock client OSX, not for a
server OSX; the latter by default uses apache's rotatelogs binary.
Look at the -v option for grep: it inverts the meaning of the match, by
selecting non-matching lines.
All other logs are rotated, also from the weekly script.
Instead, when you activate "archive every n day" in server admin, apache
continues to write log files, but with a random extension.
Yes, that's the behavior of the rotatelogs binary.
Why doesn't the "weekly" rotate excute?
How can i find out if this script realy rotates the logs? I can't wait to
let it execute again!
I need to have a constant log file name for the actual data (as it would be
with the weekly script).
How can i change the setup for this?
You would have to manually change the logging settings in apache's
configuration files; unless it is directly feasible through the GUI by
providing an appropriate log file name - not in front of a server here.
(see the man page of rotatelogs(8) for the naming of the log files).
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden