A shell recipe uses anypush to alert an Android phone when restic or borg backups fail, while successful runs remain silent and missed scheduled runs can trigger a quiet-period alert.
The anypush recipe connects restic or borg backup scripts to an Android channel. The script posts the command’s exit status and the end of its log, so a failed run can produce an alert that identifies the status and includes recent error output.
For restic, status 0 is sent as a silent heartbeat. Other statuses become high-priority alerts; the example uses tail -n 20 and curl with a 10-second timeout and up to three retries. The documented restic examples include status 3 for unreadable source data, 10 for a missing repository, 11 for a repository lock failure and 12 for a wrong password.
The same pattern can monitor borg, whose 1.x codes distinguish success, warning and error. anypush can also alert when a nightly job goes quiet for a configured period, such as one day or 25 hours. The channel address is secret, and the recipe notes that alerts confirm execution and exit status, not whether files can actually be restored; periodic restore tests are still recommended.