zscripts-token-savers/bash
KellyMichels cdeec77609 fix(bash): don't run the Windows venv python.exe on WSL/Linux/macOS
zstart's venv detection fell back to .venv/Scripts/python.exe (a Windows
binary) whenever it existed. On a Windows-built project accessed from WSL that
file sits on the mount and looks executable, so it got picked and failed with
'exec format error' instead of falling through to python3. Guard that branch to
Windows-family shells (msys/cygwin), where a .exe can actually run.

Verified on WSL: zstart --detached now backgrounds a stdlib app via python3,
serves HTTP 200, logs to /tmp/zstart-<key>.log, and zkill terminates it and
frees the port.
2026-07-22 14:49:08 -05:00
..
README.md feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
setup_backup_schedule feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zbackup feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zbackup_and_sync feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zbackup_ec2 feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zconfig.example.json feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zdeploy feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zec2 feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zec2online feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zhelpers.sh feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zkill feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zrepair feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zrestart feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zsetup_mail feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zstart fix(bash): don't run the Windows venv python.exe on WSL/Linux/macOS 2026-07-22 14:49:08 -05:00
zstart_docker feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zstop feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00
zsync feat(bash): native bash port of all z-scripts for Linux/macOS/WSL 2026-07-16 14:07:02 -05:00

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 <project> 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

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 <p> [--detached] start local dev server (python/vite/nextjs)
zkill <p> free the project's dev port
zrestart <p> [--detached] kill + start in one command
zstop <p> stop the project's compose stack on the server
zdeploy <p> [--note "msg"] zip → scp → docker compose build/up → verify build version
zec2 [<p>] TCP + HTTP + live-version reachability check
zec2online [<p>] deep health check; auto-starts downed stacks
zrepair <p> audit/repair container + proxy routing, smoke test
zbackup [<p>] [--tag t] local source zip (+ pg_dump when .env has DATABASE_URL)
zbackup_ec2 [<p>] 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-<project>.log.

Differences from the PowerShell versions

  • zsync <viteproject> 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.