Ai Chat

Automated DevOps Log Rotation and Compression Script

devops log management infrastructure system administration
Prompt
Design a robust Bash script that manages log rotation and compression for a microservices infrastructure. The script must handle multiple log directories across different services, implement retention policies (keep last 30 days), compress older logs using gzip, and generate a detailed rotation report. Include error handling for permission issues and disk space monitoring, with optional email notifications for critical events.
Sign in to see the full prompt and use it directly
Sign In to Unlock
Use This Prompt
0 uses
8 views
Pro
Bash
Technology
Mar 2, 2026

How to Use This Prompt

1
Copy the prompt Click "Copy" or "Use This Prompt" above
2
Customize it Replace any placeholders with your own details
3
Generate Paste into Ai Chat and hit generate
Use Cases
  • Automating log management for production servers.
  • Preventing disk space issues from excessive logs.
  • Simplifying compliance with log retention policies.
Tips for Best Results
  • Set appropriate retention periods for logs.
  • Monitor log sizes to adjust rotation frequency.
  • Compress old logs to save disk space.

Frequently Asked Questions

What is an automated DevOps log rotation script?
It manages log files by rotating and compressing them automatically.
Why is log rotation important?
It prevents disk space issues and keeps logs manageable.
Can I customize the rotation schedule?
Yes, you can set custom schedules based on your needs.
Link copied!