Automating repetitive tasks
There are times when you’ll want to make some tasks repetitive. You may write a script that will create a backup of a database, check users’ home directory permissions, or dump current operating system preformance metrics into a file. Modern Linux distributions provide you with two ways of setting these up. There is a third method that allows you to run a task once, at a delayed time (the at
command), but here, we’re interested in repetitive tasks.
Cron jobs
Cron is a traditional way of running tasks that need to be executed regularly at specified intervals. Usually, they should be obsolete by systemd timers, but a lot of software provides repeatability through the use of cron jobs and Alpine Linux won’t have this in the name of the minimal-sized distribution.
Cron jobs are essentially commands that are run at predefined intervals. The command and their trigger timers are defined in configuration files that live in the...