d2d4bb730a31ec14b88f51397b805b4241686d4c
Bash DevOps Portfolio
This repository is a curated collection of production-minded Bash scripts for common DevOps and platform operations tasks. The goal is to demonstrate practical shell scripting, defensive automation, clear documentation, and operational judgement.
What Is Included
| Script | Purpose |
|---|---|
scripts/system_health_report.sh |
Collects CPU, memory, disk, network, and service health into a readable report. |
scripts/docker_cleanup.sh |
Safely removes unused Docker resources with dry-run support and retention controls. |
scripts/postgres_backup.sh |
Creates compressed PostgreSQL backups with validation and retention cleanup. |
scripts/deploy_static_site.sh |
Deploys static assets atomically with rollback-friendly release directories. |
scripts/tls_certificate_check.sh |
Checks HTTPS certificate expiry for one or more domains. |
scripts/log_rotate_archive.sh |
Archives and compresses old logs without relying on system logrotate configuration. |
scripts/linux_user_bootstrap.sh |
Creates a Linux user with SSH key access and optional sudo membership. |
Repository Principles
- Scripts are documented in English and include usage examples.
- Scripts use strict mode where practical:
set -Eeuo pipefail. - Dangerous operations support a dry-run mode when appropriate.
- Inputs are validated before actions are executed.
- Output is designed for humans first, but remains easy to parse in CI logs.
- Dependencies are intentionally minimal and based on common Linux tooling.
Quick Start
Clone the repository and inspect the scripts:
git clone https://git.elevartech.com.br/elevartech/bash.git
cd bash
ls scripts
Run a script with help:
bash scripts/system_health_report.sh --help
Run the syntax validation helper:
bash tests/syntax_check.sh
Recommended Review Flow
Before using any script in production:
- Read the script header and usage examples.
- Run it with
--help. - Prefer
--dry-runfor scripts that change state. - Test in a staging environment.
- Review required permissions and environment variables.
Portfolio Notes
These scripts are intentionally general-purpose. In a real company environment, they would usually be adapted to fit:
- Monitoring and alerting tools.
- Backup destinations and retention policies.
- Deployment topology.
- Secret management standards.
- Change control and approval workflows.
The value demonstrated here is not only Bash syntax. It is the operational discipline around automation: predictable inputs, explicit failure modes, safe defaults, readable logs, and documentation that helps another engineer maintain the work.
Description
Languages
Shell
100%