вариант
Дом Список AI-промптов Терминал/Интерпретатор Генератор автоматической очистки логов Bash

Генератор автоматической очистки логов Bash

Сгенерировать автоматический скрипт очистки логов Bash, соответствующий указанному порогу хранения и сроку хранения для администраторов систем Linux, с проверкой ошибок и ведением журнала выполнения.

Содержание промпта Копировать

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.

Копировать

На основе указанного мной каталога хранения логов, порога предупреждения об использовании диска и дней хранения логов сгенерируйте исполняемый скрипт автоматической очистки Bash для Linux. Скрипт автоматически обходит каталог для удаления просроченных сжатых лог-файлов, добавляет логику проверки места на диске, дополнительно очищает несжатые старые логи при превышении порога использования каталога, также добавляет базовый перехват ошибок и вывод записи выполнения, адаптирует под распространенные системные среды 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 скриптов
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