<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>蓝色数据 &#187; logrotate</title>
	<atom:link href="http://bluedata.org/tag/logrotate/feed/" rel="self" type="application/rss+xml" />
	<link>http://bluedata.org</link>
	<description>奋斗是幸福的……</description>
	<lastBuildDate>Mon, 14 Sep 2009 01:53:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>nginx 使用 logrotate 回滚日志</title>
		<link>http://bluedata.org/2009/09/04/nginx-logrotate/</link>
		<comments>http://bluedata.org/2009/09/04/nginx-logrotate/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 07:28:49 +0000</pubDate>
		<dc:creator>Bluedata</dc:creator>
				<category><![CDATA[应用技术]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://bluedata.org/?p=293</guid>
		<description><![CDATA[vi /usr/local/nginx/conf/logrotate.conf
/var/log/nginx/*.log {
    daily
    missingok
    rotate 7
    compress
    delaycompress
    notifempty
    create 640 www-data adm
    sharedscripts
    prerotate
    sleep 59
    endscript
    [...]]]></description>
			<content:encoded><![CDATA[<p>vi /usr/local/nginx/conf/logrotate.conf<br />
<coolcode linenum="off">/var/log/nginx/*.log {<br />
    daily<br />
    missingok<br />
    rotate 7<br />
    compress<br />
    delaycompress<br />
    notifempty<br />
    create 640 www-data adm<br />
    sharedscripts<br />
    prerotate<br />
    sleep 59<br />
    endscript<br />
    postrotate<br />
        if [ -f /var/run/nginx.pid ]; then<br />
          kill -USR1 `cat /var/run/nginx.pid`<br />
        fi<br />
    endscript<br />
}</coolcode></p>
<p>调试：<br />
logrotate -d /usr/local/nginx/conf/logrotate.conf</p>
<p>执行：<br />
logrotate -f /usr/local/nginx/conf/logrotate.conf</p>
<p>定期执行：<br />
vi /etc/crontab<br />
59 23 * * * root logrotate -f /usr/local/nginx/conf/logrotate.conf</p>
]]></content:encoded>
			<wfw:commentRss>http://bluedata.org/2009/09/04/nginx-logrotate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
