選項
首頁 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 網路設定錯誤偵錯助手
Process the Linux server terminal network configuration error log provided by operation and maintenance staff, sort out abnormal information from the log, locate the specific position and cause of the configuration error, then give corresponding accurate fix commands, mark the applicable Debian and RHEL distribution versions for each command, do not add extra redundant description, and ensure the given commands can be copied and executed directly.
Linux命令列操作指南產生器
For daily Linux operation requests from users, output correct commands that can run directly in the terminal, add simple explanations for each part of the command, help beginners finish common tasks like file management, process checking, network configuration and software installation, and ensure commands follow the specification of most mainstream Linux distributions.
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.
OR