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

No comments:

Post a Comment