httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kenney, William (Info. Tech. Services)" <Kenn...@easternct.edu>
Subject RE: [users@httpd] Gracefull Apache restart?
Date Fri, 11 Oct 2002 14:03:13 GMT
Hi,

Jacob Coby supplied this great little script:

"A simpler solution would be:

cp access_log access_log.`date -I`
cat /dev/null > access_log

That will copy your current access log to "access_log.2002-08-23", and then
zero it out without any temporary files.

note that those are backticks, not single quotes in the `date -I`.

-Jacob "

I've tried it and it works quite well with some slight modifications to the
date command, I use a different Unix.

By zeroing out the log file gracefully, you don't need to restart apache.

Bill

William P. Kenney
Technical Support Specialist - Unix
Information Technology Services
Office Hours
Tuesday - Thursday 3 PM - 11 PM
Friday & Saturday 8:30 AM - 4:30 PM
(860) 465-4688
(860) 465-4675 FAX




-----Original Message-----
From: Koen Vingerhoets [mailto:koen.vingerhoets@ubench.com]
Sent: Friday, October 11, 2002 9:41 AM
To: users@httpd.apache.org
Subject: [users@httpd] Gracefull Apache restart?


Hi,

I made this once to stop Apache, delete the access_log, and start apache.
Please make comments on the script as I think it crashes our site.
Is there a way to gracefully restart Apache?? Or won't that allow me to
remove the log files??
I have absolutely no idea what I've written, it's an extensive copy paste
from all over the web.

#!/bin/sh

#/etc/init.d/httpd stop
#su - root -c "/bin/rm -f /home/httpd/vhosts/shimlar.com/logs/access_log"
>/dev/null
#/bin/rm -f /home/httpd/vhosts/shimlar.com/logs/access_log
/bin/cp /dev/null /home/httpd/vhosts/shimlar.com/logs/access_log
#/etc/init.d/httpd start

#end script


Thanks :)

Koen



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message