Three servers you can manage by hand. Twenty servers across three environments? Manual deployment is a full day’s work and a source of errors. Bash scripts are the simplest path to automation.
Deployment script¶
Downloads an artifact from Nexus, stops Tomcat on each server, copies the WAR file, starts it, runs a health check. set -euo pipefail — the script stops on the first error. The server list is in an external file.
Backup with rotation¶
Tar + gzip of configuration files. Rotation of files older than 30 days. Integrity check after creation. Failure = email alert.
Log monitoring¶
Searches for ERROR and FATAL in application logs since the last run. A state file tracks the current position. New errors are sent by email. Runs every 5 minutes via cron.
SSH multiplexing¶
SSH ControlMaster keeps a single connection open. A second SSH command is instant. On a deployment with twenty servers, this saves minutes.
Conclusion¶
Bash scripts save hours, eliminate errors and create repeatable processes. Version them in SVN and test on staging.
Need help with implementation?
Our experts can help with design, implementation, and operations. From architecture to production.
Contact us