This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
CLEAN_QIMENLOG/README.md
T
wsh5485 87ccaaa5a2 feat: 添加日志清理脚本及使用说明文档
添加自动清理qimen日志的脚本和详细使用说明
包含定时任务配置方法和时间格式说明
2025-06-17 16:12:15 +08:00

43 lines
963 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 日志清理脚本使用说明
## 脚本功能
本脚本用于自动清理 `/home/data/www/ipos/logs/qimen_log/` 目录下的 `.txt` 日志文件。
## 使用方法
1. 将脚本上传到服务器
2. 给脚本执行权限:
```bash
chmod +x /path/to/clean_logs.sh
```
3. 测试脚本运行:
```bash
/path/to/clean_logs.sh
```
## 设置定时任务
1. 编辑crontab
```bash
crontab -e
```
2. 添加定时任务(每天22点执行):
```
0 22 * * * /path/to/clean_logs.sh
```
## 自定义执行时间
crontab时间格式说明:
```
* * * * *
- - - - -
| | | | |
| | | | +----- 星期几 (0 - 6) (周日=0)
| | | +---------- 月份 (1 - 12)
| | +--------------- 日 (1 - 31)
| +-------------------- 小时 (0 - 23)
+------------------------- 分钟 (0 - 59)
```
示例:
- 每天10:30执行:`30 10 * * *`
- 每周一8:00执行:`0 8 * * 1`
- 每月1日午夜执行:`0 0 1 * *`