BalenaOS & Cron trapping for balena_engine fail

I want to set up a cron job in the Host OS Terminal to run a shell script periodically. However bash says “command not found.” How do I access cron via the Host OS terminal?

The shell script checks to see if balena_engine has failed, and, if failed, then the shell script runs a bunch of Diagnostics commands & dumps the results to a file. Works good enough for me.

I’m running BalenaOS on a NUC with 7 containers (including Supervisor). I’m having difficulty identifying the root cause of container engine crashlooping, due to the semi-random occurrence of the problem, typically middle of the night or over the weekend. By the time I get back to my NUC, memory is full of orphaned balena processes, and the NUC has screwed itself into the ground.

My hope is to capture diagnostics at the time of the initial balena_engine failure.

Thanks for assistance pointing me in the right direction.

Hi, may I suggest you enable persistent logging for that device until the issue is debugged? See Device Logs - Balena Documentation for instructions.
The balena engine has an internal healthcheck so it will restart itself if in trouble.
To answer your question, there is no mechanism for the application to run periodic jobs in the hostOS.

Thanks for the speedy & informative reply. I have turned on persistent logging & am curious to see what it shows me.