# Token Savers — bash port (Linux / macOS / WSL) Native bash versions of the z-scripts. Same commands, same `zconfig.json` schema, same behavior — no PowerShell required. ## Requirements - bash 4+, `jq`, `curl`, `zip`, OpenSSH (`ssh`/`scp`) - `lsof` (for `zkill`/`zrestart`), `rsync` (for `zsync ` mirror mode) - Docker + docker compose on the remote host for the deploy scripts Debian/Ubuntu: `sudo apt install jq curl zip lsof rsync` macOS: `brew install jq` (the rest ships with the OS) ## Install ```bash git clone https://github.com/kellymichels/zscripts-token-savers.git ~/zscripts cd ~/zscripts/bash cp zconfig.example.json zconfig.json # then fill in your values chmod +x z* setup_backup_schedule echo 'export PATH="$HOME/zscripts/bash:$PATH"' >> ~/.bashrc && source ~/.bashrc ``` ## Commands Same set as the PowerShell versions — the project key in `zconfig.json` IS the command argument: | Command | What it does | |---|---| | `zstart

[--detached]` | start local dev server (python/vite/nextjs) | | `zkill

` | free the project's dev port | | `zrestart

[--detached]` | kill + start in one command | | `zstop

` | stop the project's compose stack on the server | | `zdeploy

[--note "msg"]` | zip → scp → docker compose build/up → verify build version | | `zec2 [

]` | TCP + HTTP + live-version reachability check | | `zec2online [

]` | deep health check; auto-starts downed stacks | | `zrepair

` | audit/repair container + proxy routing, smoke test | | `zbackup [

] [--tag t]` | local source zip (+ pg_dump when .env has DATABASE_URL) | | `zbackup_ec2 [

]` | pull db dump + data dirs down from the server | | `zsync` | copy new backup files offsite (never overwrites) | | `zbackup_and_sync` | both of the above; cron-friendly | | `setup_backup_schedule --install` | daily backup cron job | | `zsetup_mail --domain d` | provision docker-mailserver mailboxes + print DNS records | | `zstart_docker` | bring up the local compose stack in `bash/docker/` | Flags use GNU style (`--port 3000`, `--detached`) instead of PowerShell style (`-Port`, `-Detached`). Detached dev servers log to `/tmp/zstart-.log`. ## Differences from the PowerShell versions - `zsync ` mirrors `dist/` with `rsync -a --delete` (robocopy /MIR equivalent). - Scheduling uses cron (`setup_backup_schedule`) instead of Windows Task Scheduler. - The MOTD banner picks a random `motd/*.txt` instead of tracking a shuffle rotation. - Windows-only helpers (`.cmd` launchers) don't exist — scripts are directly executable.