Redis 日志轮转配置
有人有 redis 的 logrotate 配置示例吗?这是我到目前为止所拥有的
/var/log/redis/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
...
endscript
}
,但我不确定在旋转后步骤中该怎么做。这是在 Ubuntu 10.04 LTS 上。
Does anyone have a sample logrotate config for redis? This is what I have so far
/var/log/redis/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
...
endscript
}
But I'm not sure what to do on the postrotate step. This is on Ubuntu 10.04 LTS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能就足够了:
This will probably suffice:
我选择这样做是
因为我不想要
copytruncate
。我不确定
create
行是否必要。它与 Ubuntu(或 Debian)上的 redis-server 通常创建的日志文件的文件模式和所有权相匹配。I went with
because I don't want
copytruncate
.I'm not sure the
create
line is necessary. It matches the file mode and ownership of the log files typically created by redis-server on Ubuntu (or Debian).