Automated Server Log Cleanup via Email Alerts with SSH - Nginx, Docker, System
This n8n workflow monitors email alerts for disk utilization exceeding 80%, extracts the server IP, logs into the server, and purges logs from Nginx, PM2, Docker, and system files to clear disk space.
Key Insights
Ensure email alerts are consistently formatted with server IP details.
SSH access must be properly configured to avoid authentication failures.
Workflow Process
Initiate the workflow with the Check Disk Alert Emails node when an email triggers on high disk usage.
Parse the email to extract the server IP using the Extract Server IP from Email node.
Set up SSH credentials and paths manually with the Prepare SSH Variables node.
Execute cleanup commands to delete logs from Nginx, PM2, Docker, and system files using the Run LogCleanup Commands via SSH node.
Usage Guide
Import the workflow into n8n and configure email and SSH credentials.
Test with a sample email alert to verify IP extraction and log deletion.
Prerequisites
Email service (e.g., IMAP or API) for alert monitoring
SSH access with valid credentials
Customization Options
Modify the Prepare SSH Variables node to target specific log directories or adjust cleanup commands for different server setups.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
📰 AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments