Repository navigation
Log retention - #370
Log retention#370hdbdn77 wants to merge 1 commit into
Conversation
| logrotate_config+="}\n" | ||
|
|
||
| # Write logrotate configuration to file | ||
| echo -e "$logrotate_config" > "/etc/logrotate.d/$dir_path_name" |
There was a problem hiding this comment.
each log file will have a logrotate config file and no cleanup for useless config file (point to not exist log file after a period time)? i do not think it is a good idea.
only one config with multi path using wildcard is suggested. example like /etc/logrotate.d/rsyslog
but we do not have a fixed log file name, glog log to filename+timestamp. so i think use logrotate is not a good idea. you may need create a script to parse and deal our logs, and put it to cron.
There was a problem hiding this comment.
我注意到,curve的日志似乎是单日志记录,而且每个日志都会放置在命名规律的文件夹下,例如etcd0、etcd1、mds0、mds1这种,所以使用了logrotate配置。如果担心日志文件被误删除导致文件名更新,我想可以再使用一个 logrotate 配置定期执行log_retention.sh就可以解决了。
b4985ba to
8b33e10
Compare
| @@ -0,0 +1,15 @@ | |||
| log_retention.sh文件使用说明: | |||
There was a problem hiding this comment.
是否每个curve节点都需要执行这个脚本才能完成日志滚动操作?
具体执行命令是bash log_rentention.sh吗?执行后的效果是什么?能否补充一个示例结果?
是否能定期执行这个脚本?如何定期执行能否举个例子?
log_rentention.sh是否改为logrotate.sh更合适?
There was a problem hiding this comment.
前三个问题已更改,请查看。
因为有清理和轮转两种功能,所以使用了log_rentention。
Signed-off-by: Liao PengFei <136953902+hdbdn77@users.noreply.github.com>
36c322a to
327899a
Compare
|
Hi @hdbdn77 首先非常感谢你的贡献 :) |
fix #197
Must be executed on the working node