Schedule automated tasks in Linux with cron jobs
Linux Nomad
In this video we demonstrate the concept of cron jobs to schedule automated commands at specific periods of time.
The cron syntax: m h dom mon dow command or m h dom mon dow /path/to/script
is the foundation of cron jobs where the user defines the time intervals using the fields:
m=minute with value in range (0-59), h=hour with value in range (0-23) where 0 is midnight, dom=day of month with value in range (1-31), mon=month with value in range (1-12), dow=day of week with value in range (0-6) where 0 is Sunday.
Cron uses 4 operator symbols which allow you to specify multiple values in a field and therefore define all kinds of time intervals: - Asterisk (*): specifies all possible values - The comma (,): specifies a list of values - Dash (-): specifies a range of values - Separator (/): specifies a step value.
Using the above syntax we define one cron job that creates a textfile every two minutes and another one that popups a terminal window and initiates a system update check. We explain the cron syntax and give some ideas of how to use the operator symbols to define various kinds of time intervals. Of course the demonstrated examples are too simple but offer the foundation of executing your own scripts in an automated scheduled way since the only thing you need to master is the cron syntax (which is not hard tbh).
References:
61783678 Bytes