On Sep 25, 2007, at 11:17 AM, James Sherwood wrote:
> We are using Apache 2.0.54 on a windows server 2003.
When I try to
> copy the logs I get the error "A program has a
partial lock on the
> file"
This means you're trying to copy a file that's being written
to, and
the OS thinks it has a good reason not to let you do that.
Why are
you trying to copy the live file? It'll get you a bunch of
stale
data and next time you copy it won't be easy to determine
the
boundary of the stuff you have already copied.
Are you trying to rotate the logs? The best way to do that
is as
follows:
1) Rename the old log file(s). Apache will continue to
write log
data to
the old files, since it has open file handles on them
and the OS
is not
fooled by something so trivial as a filename
2) Send Apache a restart (or graceful restart) by calling
c:pathtohttpd -k restart
(or -k graceful). This causes Apache to open new, empty
log
files with
the original names, closing the old open file handles.
New log
entries
will appear in the new log files without any loss.
S.
--
Sander Temme
sctemme apache.org
PGP FP: 51B4 8727 466A 0BC3 69F4 B7B8 B2BE BC40 1529 24AF
|