feat: logrotate cron task for docker users #255

This commit is contained in:
Jacky 2024-02-25 20:45:45 +08:00
parent b7f50f0053
commit 0fa98703cd
26 changed files with 663 additions and 119 deletions

View file

@ -37,7 +37,8 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
{text: 'Server', link: '/guide/config-server'},
{text: 'Nginx', link: '/guide/config-nginx'},
{text: 'Open AI', link: '/guide/config-openai'},
{text: 'Casdoor', link: '/guide/config-casdoor'}
{text: 'Casdoor', link: '/guide/config-casdoor'},
{text: 'Logrotate', link: '/guide/config-logrotate'}
]
},
{

View file

@ -42,7 +42,8 @@ export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
{text: '服务端', link: '/zh_CN/guide/config-server'},
{text: 'Nginx', link: '/zh_CN/guide/config-nginx'},
{text: 'Open AI', link: '/zh_CN/guide/config-openai'},
{text: 'Casdoor', link: '/zh_CN/guide/config-casdoor'}
{text: 'Casdoor', link: '/zh_CN/guide/config-casdoor'},
{text: 'Logrotate', link: '/zh_CN/guide/config-logrotate'}
]
},
{

View file

@ -41,7 +41,8 @@ export const zhTWConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
{text: '服務端', link: '/zh_TW/guide/config-server'},
{text: 'Nginx', link: '/zh_TW/guide/config-nginx'},
{text: 'Open AI', link: '/zh_TW/guide/config-openai'},
{text: 'Casdoor', link: '/zh_TW/guide/config-casdoor'}
{text: 'Casdoor', link: '/zh_TW/guide/config-casdoor'},
{text: 'Logrotate', link: '/zh_CN/guide/config-logrotate'}
]
},
{

View file

@ -0,0 +1,31 @@
# Logrotate
In this section, we will introduce configuration options in Nginx UI about logrotate.
**logrotate** is designed to ease administration of systems that generate large numbers of log files.
It allows automatic rotation, compression, removal, and mailing of log files.
Each log file may be handled daily, weekly, monthly, or when it grows too large.
By default, logrotate is enabled in most mainstream Linux distributions for users who install Nginx UI on the host machine,
so you don't need to modify anything.
For users who install Nginx UI using Docker containers, you can manually enable this option.
The crontab task scheduler of Nginx UI will execute the logrotate command at the interval you set in minutes.
## Enabled
- Type: `bool`
- Default: `false`
This option is used to enable logrotate crontab task in Nginx UI.
## CMD
- Type: `string`
- Default: `logrotate /etc/logrotate.d/nginx`
This option is used to set the logrotate command in Nginx UI.
## Interval
- Type: `int`
- Default: `1440`
This option is used to set the interval in minutes of logrotate crontab task in Nginx UI.

View file

@ -63,8 +63,6 @@ In Nginx UI v2, we parse the output of the `nginx -V` command to get the default
If you need to set a different path, you can use this option.
:::
## Service Monitoring and Control
In this section, we will introduce configuration options in Nginx UI for monitoring and controlling Nginx services.

View file

@ -0,0 +1,30 @@
# Logrotate
在这个部分,我们将介绍 Nginx UI 中关于 logrotate 的配置选项。
**logrotate** 旨在简化生成大量日志文件的系统的管理。
它可以按天、周、月或者文件大小来轮转日志文件,还可以压缩、删除旧的日志文件,以及发送日志文件到指定的邮箱。
默认情况下,对于在主机上安装 Nginx UI 的用户,大多数主流的 Linux 发行版都已集成 logrotate
所以你不需要修改任何东西。
对于使用 Docker 容器安装 Nginx UI 的用户,你可以手动启用这个选项。
Nginx UI 的 crontab 任务调度器将会按照你设定的分钟间隔执行 logrotate 命令。
## Enabled
- 类型:`bool`
- 默认值:`false`
这个选项用于在 Nginx UI 中启用 logrotate crontab 任务。
## CMD
- 类型:`string`
- 默认值:`logrotate /etc/logrotate.d/nginx`
这个选项用于在 Nginx UI 中设置 logrotate 命令。
## Interval
- 类型:`int`
- 默认值:`1440`
这个选项用于在 Nginx UI 中设置 logrotate crontab 任务的分钟间隔。

View file

@ -0,0 +1,29 @@
# Logrotate
在這個部分,我們將介紹 Nginx UI 中關於 logrotate 的配置選項。
**logrotate** 旨在簡化生成大量日誌文件的系統的管理。
它可以按天、周、月或者文件大小來輪轉日誌文件,還可以壓縮、刪除舊的日誌文件,以及發送日誌文件到指定的郵箱。
默認情況下,對於在主機上安裝 Nginx UI 的用戶,大多數主流的 Linux 發行版都已集成 logrotate
所以你不需要修改任何東西。
對於使用 Docker 容器安裝 Nginx UI 的用戶,你可以手動啟用這個選項。
Nginx UI 的 crontab 任務調度器將會按照你設定的分鐘間隔執行 logrotate 命令。
## Enabled
- 類型:`bool`
- 默認值:`false`
這個選項用於在 Nginx UI 中啟用 logrotate crontab 任務。
## CMD
- 類型:`string`
- 默認值:`logrotate /etc/logrotate.d/nginx`
這個選項用於在 Nginx UI 中設置 logrotate 命令。
## Interval
- 類型:`int`
- 默認值:`1440`
這個選項用於在 Nginx UI 中設置 logrotate crontab 任務的分鐘間隔。