Systemd vs Cron Watchdog: How to Keep Freqtrade Bot Running Around the Clock
Freqtrade users frequently face the problem of their trading bot silently dying after terminal sessions close, making reliable process management a top operational concern. Systemd can automatically restart a crashed or rebooted process using a simple service file, but it cannot detect a live-yet-stuck bot suffering from dropped exchange connections or hung APIs. A lightweight cron-based watchdog script, run every 15 minutes, addresses this gap by scanning /proc to reliably identify the correct process without false matches from the script itself. Beyond restart logic, the watchdog also polls Freqtrade's local REST API to log profit-and-loss data and enforce a drawdown kill switch that halts the bot if losses exceed a set threshold. The author concludes that systemd excels at keeping a binary alive, while the cron watchdog adds the observability and risk-management layer that systemd was never designed to provide.
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