# How I Built 5 Linux Automation Scripts on AWS EC2

> Source: <https://dev.to/tanayjdev/how-i-built-5-linux-automation-scripts-on-aws-ec2-3pk4>
> Published: 2026-05-23 08:21:06+00:00

I wanted to find out what working on a real Linux server actually feels like — not a local VM, not a simulator.
So in May 2026, I spun up an Ubuntu 22.04 server on AWS EC2, connected via SSH, and spent the entire month doing real work on it.
Here's what I built.
chmod
, chown
)ps
, top
, kill
, systemctl
)ss
, curl
, UFW, DNS)apt
scp
, rsync
)grep
, awk
, and sed
By the end of the month, I had built and automated 5 production-style Bash scripts.
A monitoring script that checks:
Scheduled every 15 minutes using cron.
./server_health.sh
Example output:
================================================
SERVER HEALTH CHECK REPORT
================================================
Date: 2026-05-12 10:00:00
Hostname: ip-172-xx-xx-xx
--- CPU Usage ---
✅ CPU is OK (2.3%)
--- Memory Usage ---
✅ RAM is OK (45%)
--- Services Status ---
✅ ssh: RUNNING
✅ nginx: RUNNING
✅ docker: RUNNING
--- Network ---
✅ Internet: CONNECTED
================================================
A script that scans partitions and generates alerts when disk usage exceeds a threshold.
Features:
Runs every hour through cron.
A maintenance script that:
Built using find
, gzip
, and mtime
filters for log retention management.
Runs every Sunday.
A provisioning script for creating users with a consistent setup.
Features:
sudo ./user_creation.sh --file users.csv
Creates compressed backups using tar.gz
archives.
Features:
Scheduled daily at 2 AM.
All scripts were automated using cron jobs.
# Health check — every 15 minutes
*/15 * * * * /home/ubuntu/scripts/server_health.sh >> /home/ubuntu/logs/health_cron.log 2>&1
# Disk alerter — every hour
0 * * * * /home/ubuntu/scripts/disk_alerter.sh >> /home/ubuntu/logs/disk_cron.log 2>&1
# Backup — daily at 2 AM
0 2 * * * /home/ubuntu/scripts/backup.sh >> /home/ubuntu/logs/backup_cron.log 2>&1
# Log cleaner — every Sunday at 11 PM
0 23 * * 0 /home/ubuntu/scripts/log_cleaner.sh >> /home/ubuntu/logs/cleaner_cron.log 2>&1
Once configured, the server handled routine maintenance automatically.
At the beginning, basic terminal commands felt unfamiliar.
After working daily on a remote server, navigating Linux from the command line became much more natural. There's no shortcut — you just have to do it daily.
One of the biggest mindset shifts was noticing repetitive work and immediately thinking:
"Can this be automated?"
That shift alone made scripting feel much more practical — and honestly, more fun.
Working on an actual EC2 instance exposed me to problems that are difficult to fully understand in local environments:
Solving those problems on a live server taught me far more than just reading commands from documentation.
Next, I'm moving into AWS Core Infrastructure — VPC, IAM, RDS, and Terraform.
That work starts in June 2026. Follow along if you're on a similar path.
All scripts and documentation are open source:
👉 github.com/tanayjdev/linux-bash-scripts
BCA Student • Aspiring Cloud & DevOps Engineer
