1 00:00:06,305 --> 00:00:07,410 - In this video, 2 00:00:07,410 --> 00:00:11,250 I want to give you an overview of task scheduling options. 3 00:00:11,250 --> 00:00:12,960 It all starts with cron. 4 00:00:12,960 --> 00:00:14,910 cron is a classical solution. 5 00:00:14,910 --> 00:00:18,030 It allows you to schedule reoccurring tasks. 6 00:00:18,030 --> 00:00:20,100 cron uses the crond daemon, 7 00:00:20,100 --> 00:00:23,040 and you can use crontab -e to edit tasks. 8 00:00:23,040 --> 00:00:25,410 And this is what you wanna do if you wanna make sure 9 00:00:25,410 --> 00:00:29,640 that the specific task is happening every hour, day 10 00:00:29,640 --> 00:00:33,030 or whatever, on a regular basis. 11 00:00:33,030 --> 00:00:33,863 There's also at. 12 00:00:35,070 --> 00:00:40,070 at, or at is to learn tasks once at a specific moment. 13 00:00:40,320 --> 00:00:44,640 It uses the atd daemon, and you use the at command 14 00:00:44,640 --> 00:00:46,023 to schedule the tasks. 15 00:00:46,860 --> 00:00:49,680 The third way is the systemd timer. 16 00:00:49,680 --> 00:00:52,200 As you know, systemd is taking over a lot of 17 00:00:52,200 --> 00:00:55,500 functionality that previously was done by other solutions. 18 00:00:55,500 --> 00:00:58,743 And the systemd timer is the newer alternative to cron. 19 00:01:00,000 --> 00:01:03,390 It works by creating a .timer unit, 20 00:01:03,390 --> 00:01:06,423 and you run this timer unit using systemctl. 21 00:01:07,590 --> 00:01:11,010 So what do you remember about this, when to use what? 22 00:01:11,010 --> 00:01:14,763 Well, I would advise, as a generic solution go for cron. 23 00:01:15,810 --> 00:01:19,290 It's old it's proved and everybody is using it. 24 00:01:19,290 --> 00:01:21,270 So there's nothing wrong with it. 25 00:01:21,270 --> 00:01:24,600 systemd timers, you need to be aware of them 26 00:01:24,600 --> 00:01:27,540 because as systemd is becoming more and more important 27 00:01:27,540 --> 00:01:30,330 you will see an increasing amount of systemd timers, 28 00:01:30,330 --> 00:01:33,480 and you will also see that chron jobs are being replaced 29 00:01:33,480 --> 00:01:35,280 by systemd timer jobs, 30 00:01:35,280 --> 00:01:38,370 especially in the operating system itself. 31 00:01:38,370 --> 00:01:40,830 at, is not that important. 32 00:01:40,830 --> 00:01:43,500 at is important for users that want to run a task 33 00:01:43,500 --> 00:01:46,143 at a specific moment, and once only. 34 00:01:47,040 --> 00:01:50,853 But most of the cases you'll be dealing with cron anyway.