Small Bash utilities for common DevOps tasks.
Create a timestamped .tar.gz backup of a directory.
./bin/backup_dir.sh /var/log ./backupsKeep only the newest N .log files in a directory.
./bin/rotate_logs.sh ./logs 3Pretty-print JSON using python -m json.tool.
./bin/json_pretty.sh ./sample.jsonRate-limited ping sweep for a small host range (safe defaults).
./bin/ping_sweep.sh 192.168.1 1 10Show quick disk usage details and top 10 largest items.
./bin/disk_report.sh /var- Run these tools only on systems and networks you own or are authorized to test.
ping_sweep.shis intentionally rate-limited (sleep 0.2) and defaults to a small range.rotate_logs.shdeletes files older than the keep threshold; test in a temp directory first.backup_dir.shreads source files and writes archives; ensure destination has enough free space.
.
├── .github/workflows/ci.yml # CI pipeline: ShellCheck + tests
├── CHEATSHEET.md # Fast command reference for all tools
├── README.md # Overview, usage examples, safety notes
├── bin/
│ ├── backup_dir.sh # Timestamped directory backups (.tar.gz)
│ ├── disk_report.sh # Filesystem + largest-items report
│ ├── json_pretty.sh # JSON formatter via python json.tool
│ ├── ping_sweep.sh # Safe/rate-limited subnet probe
│ └── rotate_logs.sh # Keep newest N logs, remove older logs
└── tests/
└── run_tests.sh # Bash syntax and basic execution checks
bash tests/run_tests.sh