{"slug": "how-i-built-5-linux-automation-scripts-on-aws-ec2", "title": "How I Built 5 Linux Automation Scripts on AWS EC2", "summary": "The author created an Ubuntu 22.04 server on AWS EC2 in May 2026 to gain hands-on experience with a real Linux environment, building and automating five production-style Bash scripts for server health monitoring, disk alerts, log maintenance, user provisioning, and backups. All scripts were scheduled using cron jobs to run automatically at various intervals, such as every 15 minutes for health checks and daily at 2 AM for backups. The project helped the author transition from unfamiliarity with terminal commands to a mindset focused on automating repetitive tasks, with all scripts and documentation available open-source on GitHub.", "body_md": "I wanted to find out what working on a real Linux server actually feels like — not a local VM, not a simulator.\nSo 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.\nHere's what I built.\nchmod\n, chown\n)ps\n, top\n, kill\n, systemctl\n)ss\n, curl\n, UFW, DNS)apt\nscp\n, rsync\n)grep\n, awk\n, and sed\nBy the end of the month, I had built and automated 5 production-style Bash scripts.\nA monitoring script that checks:\nScheduled every 15 minutes using cron.\n./server_health.sh\nExample output:\n================================================\nSERVER HEALTH CHECK REPORT\n================================================\nDate: 2026-05-12 10:00:00\nHostname: ip-172-xx-xx-xx\n--- CPU Usage ---\n✅ CPU is OK (2.3%)\n--- Memory Usage ---\n✅ RAM is OK (45%)\n--- Services Status ---\n✅ ssh: RUNNING\n✅ nginx: RUNNING\n✅ docker: RUNNING\n--- Network ---\n✅ Internet: CONNECTED\n================================================\nA script that scans partitions and generates alerts when disk usage exceeds a threshold.\nFeatures:\nRuns every hour through cron.\nA maintenance script that:\nBuilt using find\n, gzip\n, and mtime\nfilters for log retention management.\nRuns every Sunday.\nA provisioning script for creating users with a consistent setup.\nFeatures:\nsudo ./user_creation.sh --file users.csv\nCreates compressed backups using tar.gz\narchives.\nFeatures:\nScheduled daily at 2 AM.\nAll scripts were automated using cron jobs.\n# Health check — every 15 minutes\n*/15 * * * * /home/ubuntu/scripts/server_health.sh >> /home/ubuntu/logs/health_cron.log 2>&1\n# Disk alerter — every hour\n0 * * * * /home/ubuntu/scripts/disk_alerter.sh >> /home/ubuntu/logs/disk_cron.log 2>&1\n# Backup — daily at 2 AM\n0 2 * * * /home/ubuntu/scripts/backup.sh >> /home/ubuntu/logs/backup_cron.log 2>&1\n# Log cleaner — every Sunday at 11 PM\n0 23 * * 0 /home/ubuntu/scripts/log_cleaner.sh >> /home/ubuntu/logs/cleaner_cron.log 2>&1\nOnce configured, the server handled routine maintenance automatically.\nAt the beginning, basic terminal commands felt unfamiliar.\nAfter 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.\nOne of the biggest mindset shifts was noticing repetitive work and immediately thinking:\n\"Can this be automated?\"\nThat shift alone made scripting feel much more practical — and honestly, more fun.\nWorking on an actual EC2 instance exposed me to problems that are difficult to fully understand in local environments:\nSolving those problems on a live server taught me far more than just reading commands from documentation.\nNext, I'm moving into AWS Core Infrastructure — VPC, IAM, RDS, and Terraform.\nThat work starts in June 2026. Follow along if you're on a similar path.\nAll scripts and documentation are open source:\n👉 github.com/tanayjdev/linux-bash-scripts\nBCA Student • Aspiring Cloud & DevOps Engineer", "url": "https://wpnews.pro/news/how-i-built-5-linux-automation-scripts-on-aws-ec2", "canonical_source": "https://dev.to/tanayjdev/how-i-built-5-linux-automation-scripts-on-aws-ec2-3pk4", "published_at": "2026-05-23 08:21:06+00:00", "updated_at": "2026-05-23 08:31:29.680763+00:00", "lang": "en", "topics": ["cloud-computing", "developer-tools", "open-source"], "entities": ["AWS EC2", "Ubuntu", "Bash", "cron", "nginx", "docker", "SSH", "UFW"], "alternates": {"html": "https://wpnews.pro/news/how-i-built-5-linux-automation-scripts-on-aws-ec2", "markdown": "https://wpnews.pro/news/how-i-built-5-linux-automation-scripts-on-aws-ec2.md", "text": "https://wpnews.pro/news/how-i-built-5-linux-automation-scripts-on-aws-ec2.txt", "jsonld": "https://wpnews.pro/news/how-i-built-5-linux-automation-scripts-on-aws-ec2.jsonld"}}