Compare commits
1 Commits
05f2644f9b
...
aeefe2e895
| Author | SHA1 | Date | |
|---|---|---|---|
| aeefe2e895 |
@ -462,6 +462,21 @@ configure_node_exporter() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configure_nginx_log() {
|
||||||
|
[ $offline -eq 1 ] && return
|
||||||
|
[ "$(uname)" = "Darwin" ] && return
|
||||||
|
! command_exists nginx && return
|
||||||
|
[ ! -f /etc/logrotate.d/nginx ] && return
|
||||||
|
[ -z "$(grep 'daily' /etc/logrotate.d/nginx)" ] && return
|
||||||
|
|
||||||
|
if confirm_action "要配置 nginx 日志轮转修改为每周吗?" "N"; then
|
||||||
|
# 修改 /etc/logrotate.d/nginx 文件,替换 daily 为 weekly
|
||||||
|
sudo sed -i 's/daily/weekly/' /etc/logrotate.d/nginx
|
||||||
|
# 重新加载 logrotate 配置
|
||||||
|
sudo logrotate -f /etc/logrotate.d/nginx
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# configure_nodejs() {
|
# configure_nodejs() {
|
||||||
# [ -f /usr/local/bin/node ] && return
|
# [ -f /usr/local/bin/node ] && return
|
||||||
# [ $offline -eq 1 ] && return
|
# [ $offline -eq 1 ] && return
|
||||||
@ -562,3 +577,4 @@ configure_bootinfo
|
|||||||
configure_oomkiller
|
configure_oomkiller
|
||||||
# configure_swap
|
# configure_swap
|
||||||
configure_node_exporter
|
configure_node_exporter
|
||||||
|
configure_nginx_log
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user