mirror of
https://github.com/EtherDream/jsproxy
synced 2024-11-21 09:36:51 +00:00
日志压缩不用 brotli
This commit is contained in:
parent
a6e6b9fc16
commit
bc1cd6f170
@ -5,11 +5,6 @@ nginx 日志备份服务
|
||||
nginx 长时间运行会导致日志文件过大,该服务定期备份日志到 `backup` 目录,并进行压缩。
|
||||
|
||||
|
||||
## 依赖
|
||||
|
||||
用到了 `brotli` 压缩工具,一键安装脚本已内置,手动安装执行 `setup-brotli.sh`,最终安装在 `/home/jsproxy/brotli`。
|
||||
|
||||
|
||||
## 启动
|
||||
|
||||
```bash
|
||||
|
@ -42,14 +42,7 @@ sleep 1
|
||||
#
|
||||
echo "compress $logtime ($logsize bytes)"
|
||||
|
||||
if (( $logsize > 100 * 1024 * 1024 )); then
|
||||
# 日志较大,使用快速压缩
|
||||
nice -n 19 \
|
||||
gzip $logfile
|
||||
else
|
||||
# 日志不大,使用高强度压缩
|
||||
nice -n 19 \
|
||||
~/brotli $logfile --rm
|
||||
fi
|
||||
nice -n 19 \
|
||||
gzip $logfile
|
||||
|
||||
echo "done"
|
@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 功能:安装 brotli 压缩工具
|
||||
|
||||
git clone --depth 1 https://github.com/google/brotli.git
|
||||
cd brotli
|
||||
|
||||
make
|
||||
mv bin/brotli ~
|
||||
|
||||
cd ..
|
||||
rm -rf brotli
|
Loading…
Reference in New Issue
Block a user