Developer builds shell-script watchdog to auto-restart failed content automation lanes
A developer running five parallel content-generation pipelines built a lightweight shell script called content-watchdog.sh to eliminate daily uncertainty about whether automated tasks had completed successfully. The core problem was that scripts appeared to run — logs were created, launchd reported execution — but silent failures such as network timeouts, empty API responses, and exhausted token budgets left behind corrupt or near-empty output files. To address this, the developer adopted a 'done-marker' pattern, treating the existence of a specific dated file rather than log output as the sole proof of successful completion. The watchdog script is triggered multiple times daily by launchd and simply checks for each lane's done-marker, restarting only those that are missing, with each of the five lanes using a slightly different marker format suited to its output. The developer credits this low-overhead verification approach with allowing them to manage ten iOS apps simultaneously while keeping revenue at roughly 1.2 million yen per month.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in