Get a Text When a Job Finishes or Fails

uxrun runs any command for you, then texts you when it's done: how long it took, or the error and the last lines of output if it failed. Start a backup, a build or a long copy, and walk away.

What the texts look like

Done: make build (took 3m12s)
FAILED (exit 2): make build after 41s - <last lines of output>

The command's own output still shows on screen while it runs.

1. Get your API key

It's on your account screen. No account yet? Start a free trial, then add your mobile number on the account screen so alerts come by text.

Easiest: run uxsend once. It asks for the key and saves it, and the other example programs then find it automatically. Or set it yourself in USERALERTX_API_KEY.

2. Download and run

Windows: uxrun.ps1. In PowerShell:

.\uxrun.ps1 "robocopy C:\Data D:\Backup /MIR" -OkCodes 0,1,2,3

-OkCodes lists the exit codes that mean success. robocopy counts 0–7 as success; most programs just use 0, the default.

Mac / Linux: uxrun.sh:

chmod +x uxrun.sh
./uxrun.sh make build
./uxrun.sh ./backup.sh --full
./uxrun.sh -m sms rsync -a /data /backup     # always by text (-m email = email)

Test without sending: set USERALERTX_DRYRUN=1 (Mac/Linux) or $env:USERALERTX_DRYRUN="1" (PowerShell), and it shows the text it would send instead.

Good to know

  • Cost: one alert per run, 1 token by text or 0.1 by email.
  • In a scheduled job: put uxrun in front of the command in cron or Task Scheduler, and you hear about every nightly run, good or bad.
  • Only want to hear about failures? Use the pattern on the uxsend page: job || ./uxsend.sh "Job FAILED".