Scheduled vs Supervised Tasks

Scheduled vs Supervised Tasks

Scheduling tasks in Linux is traditionally done with the Cron Task Scheduler.  There are many online resources about cron, one of which is this site,  With Webmin, the task scheduling can be managed through the WebUI.  Details can be found here,   Here is a simple scheduled task that reboots the Linux host daily at 1:30am.

30 1 * * * systemctl reboot -i

Scheduling this in Cron or through Webmin results in the same entry in the respective crontab file.

Some tasks are poorly designed, or implemented in a way that they weren’t intended for.  In those instances, the process can do some strange things.  This can result in a process hang, memory leak, or cascading processes that exhaust system resources, to name some examples.  Restarting those processes is a quick and dirty workaround, but by no means a fix.  This is where scheduled tasks can be leveraged.

13,28,43,58 * * * * node-red-restart

Some tasks don’t lend themselves well to automated scheduling, one of them being RTL433.  This particular example,, would run for a period of time, but then stop for one reason or another.  Here is where Supervisor has been demonstrated to help keep tasks running,  Depending on the extensive use of Supervisor, some might argue that each task have its own conf file with the command parameters contained in each.  Here is an example of a conf file located in this path, /etc/supervisor/conf.d/rtl443.conf.

command=/bin/sh /home/local/Tasks/

Everyone is free to do as they see fit, whether they see it that way or not, consequence is secondary.

Comments are closed.