diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml new file mode 100644 index 0000000..f7e3a29 --- /dev/null +++ b/.github/workflows/safety.yml @@ -0,0 +1,12 @@ +name: Isolated script safety +on: [push, pull_request] +permissions: + contents: read +jobs: + fixtures: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - name: Bash syntax and local fixture regressions + run: python3 -m unittest discover -s tests -v diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..41c33c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +__pycache__/ +*.pyc diff --git a/README.md b/README.md index 751a810..6177c4a 100644 --- a/README.md +++ b/README.md @@ -1,189 +1,58 @@ -# ๐Ÿง Linux Admin Scripts +# Linux Admin Scripts -A production-ready collection of Bash scripts for Linux system administration โ€” monitoring, alerting, backup, maintenance, and security auditing. +9 September continuation: shared backup publication now refuses existing checksum files, symlinks and directories. Both daily and weekly paths publish checksums with no-clobber hard links; a checksum-generation failure cannot report a verified backup. Interrupted publication may still leave an archive without its final checksum, so require a valid checksum pair and investigate retained partial artifacts. This adds two isolated regression tests (12 total); application-consistent restoration remains a lab gate. -> All scripts include centralized Slack/Teams/Email alerting, lock files, log rotation, and proper error handling. +Bash administration utilities. Validate each script in a disposable lab before production deployment. Syntax checks and fixture tests do not certify an environment or an application backup. ---- +## Entry points -## ๐Ÿ“ Repository Structure +Use `bash `; several maintained entry points intentionally have no `.sh` extension. -``` -linux-admin-scripts/ -โ””โ”€โ”€ scripts/ - โ”œโ”€โ”€ core/ โ† Shared alert engine (load this first) - โ”œโ”€โ”€ audit/ โ† Security & system auditing - โ”œโ”€โ”€ monitoring/ โ† Resource & service monitoring - โ”œโ”€โ”€ backup/ โ† Backup & rotation scripts - โ””โ”€โ”€ maintenance/ โ† Cleanup & housekeeping -``` +| Path | Behavior and scope | +| --- | --- | +| `scripts/monitoring/server-stats.sh` | Local statistics snapshot; unchanged in the September remediation. | +| `scripts/monitoring/cpu_memory_monitor` | CPU/memory observations; local log and stderr alerts. | +| `scripts/monitoring/disk_alert` | One GNU df collection; warning/critical or unavailable collection returns nonzero. | +| `scripts/monitoring/service_uptime ...` | Explicit service scope, alert-only; never restarts a service. | +| `scripts/backup/backup_script ` | Verified, versioned file archive; retention inventory only. | +| `scripts/backup/backup_rotation.sh` | Versioned daily/weekly archives; requires SRC_DIR, BACKUP_DIR and EXPECTED_BACKUP_SOURCE. | +| `scripts/Nginx_create.sh