Get notified when your script finishes
July 14, 2026 · 4 min read
You started the training run, the render, the database migration – and now you check the terminal every ten minutes. Append one command and your phone tells you instead, with different sounds for success and failure.
The shell pattern
python train.py \
&& curl -X POST "$WEBHOOKY_URL" -H "Content-Type: application/json" \
-d '{"title":"✅ Training done","sound":"level_complete"}' \
|| curl -X POST "$WEBHOOKY_URL" -H "Content-Type: application/json" \
-d '{"title":"🚨 Training FAILED","sound":"error_1"}'
&& fires on success, || on failure – you hear the outcome without reading anything. Put the endpoint URL in an environment variable and this works for any command: ffmpeg, rsync, terraform apply, test suites.
A shell function for your dotfiles
notify() { # usage: long_command; notify $?
local status=${1:-$?}
if [ "$status" -eq 0 ]; then
curl -s -X POST "$WEBHOOKY_URL" -d '{"title":"✅ Job done"}' > /dev/null
else
curl -s -X POST "$WEBHOOKY_URL" -d '{"title":"🚨 Job failed ('"$status"')","sound":"error_1"}' > /dev/null
fi
}
Inside Python, with results in the message
import requests, time
start = time.time()
model, accuracy = train()
requests.post(WEBHOOKY_URL, json={
"title": "✅ Training finished",
"message": f"accuracy={accuracy:.3f} · {(time.time()-start)/60:.0f} min",
"sound": "level_complete",
})
Putting the key metric in the message is the real win: you know from your pocket whether the run is worth walking back to the desk for.
Remote machines & notebooks
The same POST works from a rented GPU box, a Colab/Jupyter cell or CI – anywhere with outbound HTTPS. No SSH tunnels, no tmux babysitting, no “keep the laptop open”.
Get Webhooky
Free for your first 100 notifications – set up your endpoint in two minutes.