{"id":57,"date":"2003-04-05T10:05:58","date_gmt":"2003-04-05T17:05:58","guid":{"rendered":"http:\/\/blogs.pugetsound.edu\/TSmaintenance\/?p=57"},"modified":"2003-04-05T10:05:58","modified_gmt":"2003-04-05T17:05:58","slug":"www-monthly-log-rotation-set-up","status":"publish","type":"post","link":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/2003\/04\/05\/www-monthly-log-rotation-set-up\/","title":{"rendered":"WWW Monthly Log Rotation Set Up"},"content":{"rendered":"<p>Automatic monthly Apache log rotation was set up on the main web server, www.ups.edu.<br \/>\n<!--more--><br \/>\nA shell script called logrotate.sh was written that will move the access, error and ssl logs to \/web\/logs and write its output to \/var\/log\/logrotate.log<\/p>\n<p>logrotate.sh resides in \/usr\/local\/apache\/logs<\/p>\n<p>source of script is:<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nmv \/usr\/local\/apache\/logs\/access_log \/web\/logs\/access_log`date +%Y-%m-%d`<br \/>\nmv \/usr\/local\/apache\/logs\/error_log \/web\/logs\/error_log`date +%Y-%m-%d`<br \/>\nmv \/usr\/local\/apache\/logs\/ssl_engine_log \/web\/logs\/ssl_engine_log`date +%Y-%m-%d`<br \/>\nmv \/usr\/local\/apache\/logs\/ssl_request_log \/web\/logs\/ssl_request_log`date +%Y-%m-%d`<br \/>\n\/usr\/local\/apache\/bin\/apachectl graceful<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>The moved files will have a date in their names &#8211; an example of the format should be:<\/p>\n<p>access_log2003-5-1<\/p>\n<p>The year (in this case 2003) and the month (in this case May [5]) will change, but the day (1) will not. Rotation will always be at midnight on the first day of every month. <\/p>\n<p>The last line allows apache to be restarted without interaction from the command line.<\/p>\n<p>This script has been inserted into the crontab for root.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automatic monthly Apache log rotation was set up on the main web server, www.ups.edu.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-reconfigurationmisconfiguration"],"_links":{"self":[{"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":0,"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.pugetsound.edu\/tsmaintenance\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}