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:
https://en.wikipedia.org/wiki/Cron
https://vitux.com/scheduling-a-task-o...
https://www.tecmint.com/create-and-ma...
https://fedoramagazine.org/scheduling...
Смотрите видео Schedule automated tasks in Linux with cron jobs онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Linux Nomad 09 Сентябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 140 раз и оно понравилось 4 людям.