<?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; 日志切割</title>
	<atom:link href="http://www.osyunwei.com/archives/tag/%e6%97%a5%e5%bf%97%e5%88%87%e5%89%b2/feed" rel="self" type="application/rss+xml" />
	<link>https://www.osyunwei.com</link>
	<description>国产化OS/AnolisOS/openEuler/RHEL/CentOS/Rocky Linux/Debian/Ubuntu Linux FreeBSD 服务器教程 &#124; Windows Server 2003/2008/2012/2016/2019/2022/2025服务器教程</description>
	<lastBuildDate>Tue, 14 Apr 2026 10:59:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux下nginx日志每天定时切割</title>
		<link>https://www.osyunwei.com/archives/9787.html</link>
		<comments>https://www.osyunwei.com/archives/9787.html#comments</comments>
		<pubDate>Tue, 08 Nov 2016 01:14:47 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[日志切割]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=9787</guid>
		<description><![CDATA[教程目的： 使用Linux系统自带的命令logrotate对Nginx日志进行切割。 Nginx安装目录：/usr/local/nginx/ Nginx日志目录：/usr/local/nginx/logs/、/usr/local/nginx/logs/nginx_logs/ 1、添加nginx日志切割脚本 cd  /etc/logrotate.d  #进入目录 vi   /etc/logrotate.d/nginx   #编辑脚本 /usr/local/nginx/logs/*.log  /usr/local/nginx/logs/nginx_logs/*.log{ su root www missingok dateext notifempty daily rotate 7 create 0640 www adm sharedscripts postrotate if [ -f /usr/local/nginx/logs/nginx.pid ]; then kill -USR1 `cat /usr/local/nginx/logs/nginx.pid` fi endscript } :wq!  #保存退出 chmod +x  /etc/logrotate.d/nginx  ＃添加执行权限 chmod 644 /etc/logrotate.d/nginx  #修改权限 &#160; 2、执行脚本 /usr/sbin/logrotate -vf  [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/9787.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/9787.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
