选项
首页 AI 提示词列表 终端/口译员 Bash 自动化日志清理工具生成器

Bash 自动化日志清理工具生成器

为Linux系统管理员生成满足指定存储阈值和保留周期的自动化Bash日志清理脚本,附带错误检查和执行日志输出能力,适配常见发行版环境。

提示内容 复制

Based on the log storage directory, disk usage warning threshold and log retention days I provide, generate a runnable Bash automation cleaning script for Linux. The script automatically traverses the directory to delete expired compressed log files, add disk space judgment logic, additionally clean uncompressed old logs when directory usage exceeds the threshold, also add basic error capture and execution record output, adapt to common CentOS and Ubuntu system environments.

复制

你需要根据我给出的日志存储目录、磁盘占用警告阈值和日志保留天数,生成可直接在Linux系统执行的Bash自动化清理脚本,脚本要自动遍历目录删除超期的压缩日志文件,加入磁盘空间判断逻辑,当目录占用超过阈值时额外清理未压缩的旧日志,还要加入基本的错误捕获和执行记录输出,适配CentOS和Ubuntu常见系统环境。

复制
评论 (0)
0/300

推荐

Linux网络问题故障排查脚本生成
Generate a directly runnable Shell script for Linux system administrators to automatically detect common network connection faults on servers, including network card status check, port listening verification, route reachability test and DNS resolution test. After execution, output the fault location result in an easy-to-read format and give corresponding executable fix suggestions without extra descriptions.
Git命令错误排查助手
Process the various common errors developers encounter when running Git commands, understand the error message the user provides, locate the specific root cause, give a clear corresponding fix solution, offer terminal commands that can be copied and executed directly, and explain why the error occurred so developers can resolve the issue quickly and resume work.
Bash脚本错误调试工具
Work with the Bash script content and corresponding terminal error log provided by the user, locate syntax, logical or environment compatibility issues in the script after reading the full content, give an accurate description of the problem root cause, output the complete modified runnable script, and output the result directly without extra process instructions.
Python脚本bug定位工具
Check the small to medium Python script provided by the developer, find syntax mistakes and common runtime logic errors, output the complete fixed runnable code, and explain each error's cause and the modification idea in plain language.
Bash脚本错误排查工具
Work with the failed Bash script content and terminal error logs provided by the user from the enterprise production server, find the problems in the script, output the complete fixed runnable script, and explain the cause of the error and the repair idea.
Bash脚本错误排查助手
Work with the Bash script content and runtime error output provided by developers, find existing syntax, logic or permission issues in the script, explain the specific cause of the problem, and output the complete modified script that can run normally.
OR