Production-style Linux automation scripts built and tested on AWS EC2 using Bash.
This repository contains real-world Linux administration and DevOps automation scripts focused on:
- server monitoring
- disk usage management
- automated backups
- log cleanup
- user provisioning
- log analysis
- cron automation
All scripts were developed during hands-on Linux + AWS practice on Ubuntu servers.
The goal of this project was to simulate practical system administration and DevOps tasks commonly handled in real production environments.
Instead of writing isolated beginner scripts, this project focuses on:
- reusable automation
- logging and reporting
- error handling
- monitoring workflows
- scheduled execution
- operational maintenance
| Script | Purpose | Key Features |
|---|---|---|
server_health.sh |
Complete server monitoring | CPU, RAM, Disk, Services, Network |
disk_alerter.sh |
Disk usage monitoring | Threshold alerts, logs, reports |
log_cleaner.sh |
Log maintenance automation | Compression, deletion, cleanup reports |
user_creation.sh |
User provisioning automation | Validation, groups, sudo setup |
backup.sh |
Automated backup system | Compression, verification, retention |
find_large_files.sh |
Disk investigation tool | Detects storage-heavy files |
log_analyzer.sh |
Log analysis utility | grep + awk + sed powered summaries |
- Linux (Ubuntu 24.04 LTS)
- Bash Scripting
- AWS EC2
- Cron Jobs
- grep
- awk
- sed
- tar
- gzip
- SSH / SCP / rsync
| Component | Details |
|---|---|
| OS | Ubuntu 24.04 LTS |
| Cloud Platform | AWS EC2 |
| Instance Type | t2.micro |
| Shell | Bash |
| Architecture | Linux CLI based automation |
linux-bash-scripts/
│
├── backup.sh
├── disk_alerter.sh
├── find_large_files.sh
├── log_analyzer.sh
├── log_cleaner.sh
├── server_health.sh
├── user_creation.sh
│
├── logs/
├── backups/
└── README.md
Cron Job
↓
Monitoring Script
↓
Logs Generated
↓
Alerts Triggered
↓
Cleanup / Backup Automation
- CPU monitoring
- RAM monitoring
- Disk usage monitoring
- Service status checks
- Network connectivity checks
- Scheduled cron execution
- Automated cleanup
- Automated backups
- Automated alert generation
- User provisioning
- Group management
- Permission handling
- Backup retention policies
- Error detection
- Warning extraction
- Pattern filtering
- Statistical summaries
git clone https://github.com/tanayjdev/linux-bash-scripts.git
cd linux-bash-scriptschmod +x *.sh./server_health.sh- CPU usage
- RAM usage
- Disk usage
- Running services
- Internet connectivity
================================================
SERVER HEALTH CHECK REPORT
================================================
CPU Usage: 12%
RAM Usage: 43%
Disk Usage: 38%
ssh: RUNNING
docker: RUNNING
nginx: RUNNING
Internet: CONNECTED./disk_alerter.sh- monitors all partitions
- threshold-based alerts
- log file generation
- alert reporting
ALERT: / is at 85%./log_cleaner.sh- deletes old logs
- compresses recent logs
- cleanup reporting
- storage optimization
sudo ./user_creation.sh --interactivesudo ./user_creation.sh --file users.csvusername, full_name, group, sudo
- username validation
- automatic home creation
- sudo assignment
- group management
- welcome file creation
./backup.sh- compressed backups
- integrity verification
- retention cleanup
- multiple source support
- automatic logging
Backup created successfully
Verification passed./find_large_files.sh /home 100M./find_large_files.sh / 1G./log_analyzer.sh /path/to/logfile.log- error counts
- warning counts
- hourly distribution
- filtered summaries
The following cron jobs were configured during testing:
# Health check every 15 minutes
*/15 * * * * /home/ubuntu/scripts/server_health.sh >> /home/ubuntu/logs/health.log 2>&1
# Disk alerts every hour
0 * * * * /home/ubuntu/scripts/disk_alerter.sh >> /home/ubuntu/logs/disk.log 2>&1
# Daily backups at 2 AM
0 2 * * * /home/ubuntu/scripts/backup.sh >> /home/ubuntu/logs/backup.log 2>&1
# Weekly log cleanup
0 23 * * 0 /home/ubuntu/scripts/log_cleaner.sh >> /home/ubuntu/logs/cleaner.log 2>&1- process management
- user management
- file permissions
- disk operations
- package management
- variables
- loops
- functions
- arrays
- conditionals
- return codes
- cron scheduling
- monitoring workflows
- cleanup automation
- backup automation
- grep
- awk
- sed
- pipelines
- filtering and parsing
- AWS EC2
- SSH
- SCP
- rsync
- connectivity troubleshooting
Through this project I learned:
- how to automate repetitive Linux administration tasks
- how monitoring systems are structured
- how cron jobs are used in production
- how backup retention policies work
- how log analysis is performed using CLI tools
- how to write modular and reusable bash scripts
- how to manage Linux users and permissions
- how to troubleshoot SSH and server connectivity issues
These scripts simulate operational tasks commonly performed by:
- DevOps Engineers
- Linux System Administrators
- Site Reliability Engineers (SREs)
- Cloud Engineers
The project focuses on practical automation rather than theoretical examples.
Planned improvements include:
- email alerts
- Slack/Discord notifications
- centralized logging
- monitoring dashboards
- AWS S3 backup integration
- Docker container monitoring
- Terraform deployment integration
Tanay Jain
Built as part of a long-term Cloud & DevOps Engineering learning roadmap.
This project is licensed under the MIT License.