Various snippets of UNIX code that might just be a waste if I keep them to myself. This blog is very much a work in progress and is mainly for myself. Yes, I should probably host code on one of those fancy code hosting web sites and I probably will eventually.
Thursday, April 10, 2014
Apache: crude rolling over of logs
if the apache in question doesn't have automated rolling over of logs you can easily do this ...
sourcery:/web/server/httpd/logs # mv svn-access_log svn-access_log-20130909
or if you don't particular care to keep the logs you can do ...
sourcery:/web/server/httpd/logs # > error_log
and then you need to restart the apache
sourcery:/web/server/httpd/logs # /etc/init.d/httpd restart
(usually) a new logfile will get created by apache, but I went to http://svn/ and logged in and that kicked off the new logfile (sourcery has one of
those create log files as it needs them apache logging mechanism)
sourcery:/web/server/httpd/logs # bzip2 -9 svn-access_log-20130909 &
i also do an 'lsof' before I do a bzip just to make sure nothing has that log file open any more
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment