Let your cron jobs report in β
One line at the end of a job and your phone knows how it went. Sending without a topic goes straight to your own devices, so there is nothing to set up first.
Good for: backups, certificate renewals, batch imports, long-running builds, anything that runs unattended and should be able to reach you when it matters.
bash
#!/bin/sh
if ./backup.sh; then
sp notify --title "β
Backup done" --content "db-host nightly, $(date +%F)"
else
sp notify --title "π¨ Backup failed" --content "Check /var/log/backup.log on db-host"
fipython
import subprocess
from simplepush import Client
client = Client(api_token="YOUR_API_TOKEN")
result = subprocess.run(["./backup.sh"])
if result.returncode == 0:
client.send_notification(title="β
Backup done", content="db-host nightly")
else:
client.send_notification(
title="π¨ Backup failed",
content="Check /var/log/backup.log on db-host",
)ts
import { Client } from '@simplepush/sdk'
const client = new Client({ apiToken: process.env.SP_API_TOKEN! })
try {
await runBackup()
await client.sendNotification({ title: 'β
Backup done', content: 'db-host nightly' })
} catch {
await client.sendNotification({
title: 'π¨ Backup failed',
content: 'Check /var/log/backup.log on db-host',
})
}bash
curl -X POST https://api.simplepu.sh/v1/notifications \
-H "API-Token: $SP_API_TOKEN" \
-H "Title: β
Backup done" \
-H "Content: db-host nightly, finished in 74s"The CLI reads the token from $SP_API_TOKEN, so a cron environment only needs that one variable. Notifications count against a generous daily allowance, so a handful of job reports per night costs you nothing.
Want the failure case to demand attention instead of scrolling by? Send a task with choices (Retry,Skip,Wake me up) instead of a plain notification, and let the job wait for your answer.