Option
Heim KI-Prompt-Liste Terminal/Dolmetscher Automatisierter Bash-Log-Reinigungsgenerator

Automatisierter Bash-Log-Reinigungsgenerator

Erstellen Sie ein automatisiertes Bash-Log-Reinigungsskript, das den angegebenen Speicherschwellenwert und Aufbewahrungszeitraum für Linux-Systemadministratoren erfüllt, mit Fehlerprüfung und Ausführungsprotokollierung.

Prompt-Inhalt Kopieren

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.

Kopieren

Basierend auf dem von mir angegebenen Log-Speicherverzeichnis, dem Warnschwellenwert für die Datenträgerauslastung und den Log-Aufbewahrungstagen erstellen Sie ein ausführbares Bash-Automatisierungs-Reinigungsskript für Linux. Das Skript durchläuft automatisch das Verzeichnis, um abgelaufene komprimierte Logdateien zu löschen, fügt eine Logik zur Prüfung des Speicherplatzes hinzu, löscht zusätzlich unkomprimierte alte Logs, wenn die Verzeichnisauslastung den Schwellenwert überschreitet, fügt auch grundlegende Fehlererfassung und Ausführungsaufzeichnung hinzu und passt sich an gängige CentOS- und Ubuntu-Systemumgebungen an.

Kopieren
Kommentare (0)
0/300

Empfehlung

Linux Netzwerk-Fehlerbehebungs-Skript-Generator
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-Befehls Fehlerbeheber
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-Skript-Debugging-Tool
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-Skript-Bug-Debugger
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-Skript-Fehlerdebugger
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-Skript Debug-Assistent
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