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.
87ccaaa5a263bf0d042b99df5bb18e1c3d28cb8e
日志清理脚本使用说明
脚本功能
本脚本用于自动清理 /home/data/www/ipos/logs/qimen_log/ 目录下的 .txt 日志文件。
使用方法
- 将脚本上传到服务器
- 给脚本执行权限:
chmod +x /path/to/clean_logs.sh
- 测试脚本运行:
/path/to/clean_logs.sh
设置定时任务
- 编辑crontab:
crontab -e
- 添加定时任务(每天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 * *
Description