option
Maison Liste de prompts IA Terminal/Interprète Générateur de nettoyeur de journaux Bash automatisé

Générateur de nettoyeur de journaux Bash automatisé

Générer un script Bash de nettoyage automatisé de journaux répondant au seuil de stockage et à la période de conservation spécifiés pour les administrateurs système Linux, avec vérification d'erreurs et journalisation d'exécution.

Contenu du prompt Copier

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.

Copier

Sur la base du répertoire de stockage des journaux, du seuil d'avertissement d'utilisation du disque et du nombre de jours de conservation des journaux que je fournis, génère un script de nettoyage automatisé Bash exécutable pour Linux. Le script parcourt automatiquement le répertoire pour supprimer les fichiers de journaux compressés expirés, ajoute une logique de jugement de l'espace disque, nettoie en plus les anciens journaux non compressés lorsque l'utilisation du répertoire dépasse le seuil, ajoute également une capture d'erreur de base et une sortie d'enregistrement d'exécution, s'adapte aux environnements système courants CentOS et Ubuntu.

Copier
commentaires (0)
0/300

Recommandation

Générateur de script de dépannage réseau 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.
Outil de dépannage d'erreurs 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.
Outil de débogage de script 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.
Débogueur de bogues 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.
Outil de débogage d'erreurs 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.
Assistant de débogage de script 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