Originally, in the old library used on MudOS, we had a handler for functionalities that needed to run periodically, which was timed.c
. Its operation was somewhat archaic, requiring each desired action to be added manually in a not very intuitive way, and it wasn’t very maintainable. We have evolved this towards a cron
+ crontab
system, similar to how it operates in an operating system.
Now there exists a crontab
file at /save/crontab
, structured like this:
# Edit this file to introduce tasks to be run by cron. |
Each line represents a functionality to be executed periodically, a specific function from a specific file. The left values represent the minutes and hours of the day. For example, we can see that 0 */23
means that at hours divisible by 23 (actually eleven at night, we could have just put 23), at 0 minutes (exactly eleven o’clock), an auto_reboot
will be executed. Or that every hour (*
), at minutes divisible by 10 (*/10
), it will check if we are using too much memory or not, to potentially force another reboot.
It doesn’t have as many configuration options as a real crontab
from an operating system, but it’s probably sufficient for the needs we’re going to have, and it’s already much better than what we had before.