Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rotate log for apache behaves strange



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").
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.

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?

Thansk for you help.

Wolfram


 _______________________________________________
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

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.