PowerShell
For a script run by Windows Task Scheduler. $LASTEXITCODE holds the exit status of the last program the script ran.
$url = "https://staging.crony.sh/ping/f3a1c6e2-8d4b-4c7a-9e15-2b6d0c9a7f31"
Invoke-RestMethod "$url/start" -TimeoutSec 10 | Out-Null
& C:\Tools\backup.exe
$status = $LASTEXITCODE
# Windows exit codes can fall outside 0-255; report those as a plain failure.
$signal = if ($status -ge 0 -and $status -le 255) { $status } else { "fail" }
Invoke-RestMethod "$url/$signal" -TimeoutSec 10 | Out-Null
exit $statusTo send output with the ping, use -Method Post -Body $output.