1 00:00:01,020 --> 00:00:01,640 Hello, everyone. 2 00:00:02,660 --> 00:00:06,440 And this still I'm going to show you how to schedule Chron jobs. 3 00:00:07,660 --> 00:00:09,100 Linux operating systems. 4 00:00:09,390 --> 00:00:16,390 We can show you a con jobs to run and execute commands and scripts at specific date and time. 5 00:00:17,790 --> 00:00:23,600 In order to run an execute con jobs, we need to round Chron top comment. 6 00:00:24,680 --> 00:00:30,200 Let's start with the first command, if I would like to, a few of the structure of the crown top entry. 7 00:00:30,200 --> 00:00:39,010 So I'm going to type the command cat, then slash DGC slash crown chap and had enter. 8 00:00:39,230 --> 00:00:42,910 As you can see here, he is the structure of the crown type entry. 9 00:00:43,400 --> 00:00:46,520 You can see here we have the first field. 10 00:00:46,550 --> 00:00:47,330 We have the minutes. 11 00:00:47,420 --> 00:00:49,400 The second one hours. 12 00:00:49,760 --> 00:00:51,120 Third the day of the month. 13 00:00:51,170 --> 00:00:53,390 Then we have the month. 14 00:00:53,690 --> 00:00:54,320 The fourth one. 15 00:00:54,650 --> 00:00:57,440 And the last one is the day of the week. 16 00:00:58,910 --> 00:01:07,160 Now, if I would like to view the current top for the current user right now, use the route. 17 00:01:07,490 --> 00:01:09,020 So I'm going to tap crown. 18 00:01:09,930 --> 00:01:11,620 Tap, dash. 19 00:01:12,470 --> 00:01:19,060 Well, in order to view the current tap for the current, use it so far, we don't have any contact 20 00:01:19,070 --> 00:01:21,350 for the user route. 21 00:01:22,290 --> 00:01:29,400 If I would like to fuel the current tap for another user, for example, Krahn Tap. 22 00:01:29,970 --> 00:01:35,340 I would like to view as a current tap for the user student. 23 00:01:35,540 --> 00:01:38,710 Then here's student dash. 24 00:01:39,510 --> 00:01:43,560 So Chron tap dash you then the name of the user. 25 00:01:43,560 --> 00:01:44,460 Damed action. 26 00:01:45,080 --> 00:01:48,510 As you can see here, there is no chron tap for student. 27 00:01:49,640 --> 00:01:58,250 If I would like to edit the current tab for the current user run tab, then dash it hit, enter is going 28 00:01:58,250 --> 00:01:58,850 to open. 29 00:02:00,570 --> 00:02:07,770 Text that or edit your debt, I have to add the contact there on this question and go back if I would 30 00:02:07,770 --> 00:02:08,490 like to. 31 00:02:09,660 --> 00:02:17,280 Edit the content for user, for example, stood in Chron Chap, then same thing. 32 00:02:17,400 --> 00:02:20,700 He does show you this is what the user Deyn student. 33 00:02:21,750 --> 00:02:31,920 Then dash e I hit enter and it's going to being an editor and I can add my crohn chops over there. 34 00:02:32,670 --> 00:02:34,230 Let's do two examples. 35 00:02:34,980 --> 00:02:38,550 The first example I would like to do which with Route User. 36 00:02:39,030 --> 00:02:49,290 So I would like to run every two minutes to update the timestamp of the slash ATC slash bass, the best 37 00:02:49,290 --> 00:02:50,100 WD five. 38 00:02:50,730 --> 00:02:56,820 So before I'm going to do anything, I'm going to show the structure of the current TAB entry. 39 00:02:56,910 --> 00:03:04,190 So I'm going to tie this cat, slash EDC, slash crohn tap enter. 40 00:03:04,520 --> 00:03:10,060 So right now I have what I have the structure now of the crunch engine. 41 00:03:10,770 --> 00:03:16,640 So the question is, run every two minutes to update the timestamp of the. 42 00:03:17,850 --> 00:03:20,800 Defy what the slash DC slash best ability. 43 00:03:21,510 --> 00:03:27,480 So in this case, what the command any to use in order to update the timestamp, the touch comment. 44 00:03:28,050 --> 00:03:30,300 So touch wisht touch. 45 00:03:30,660 --> 00:03:39,840 So I need this bath in order to add it with the crown top before I'm going to open an editor in order 46 00:03:39,840 --> 00:03:42,630 to add the current tab for this is my way. 47 00:03:42,660 --> 00:03:44,520 How I do it, I usually write it here. 48 00:03:44,550 --> 00:03:45,090 I copy it. 49 00:03:45,120 --> 00:03:46,950 Then I pasted over there. 50 00:03:47,070 --> 00:03:47,430 So. 51 00:03:48,960 --> 00:03:50,130 Let's read the question again. 52 00:03:50,190 --> 00:03:51,450 Run every two minutes. 53 00:03:52,500 --> 00:03:54,330 So we're going to start with the first field here. 54 00:03:54,450 --> 00:03:57,120 So every two minutes or start slashed to be good. 55 00:03:57,420 --> 00:04:00,330 We're going to use the slash because it's every two minutes. 56 00:04:00,900 --> 00:04:02,460 And there is nothing about the hour. 57 00:04:02,460 --> 00:04:03,760 So I'm going to leave it. 58 00:04:03,770 --> 00:04:12,550 Did the default value, which is the start space and I need to have space between those between the 59 00:04:12,610 --> 00:04:13,950 different digits or the second. 60 00:04:13,980 --> 00:04:16,110 Also the second digit then space. 61 00:04:16,440 --> 00:04:18,690 We don't have anything for the day of the month. 62 00:04:18,779 --> 00:04:22,910 So then I'm going to leave the default star month. 63 00:04:23,460 --> 00:04:24,770 I don't have anything for the month. 64 00:04:24,780 --> 00:04:26,880 And the question in space. 65 00:04:27,270 --> 00:04:34,120 Then also, I don't have anything the day of the week, so I'm going to try stuff. 66 00:04:35,010 --> 00:04:40,380 So every two minutes or star slash two and I don't have anything. 67 00:04:40,380 --> 00:04:48,290 Space start, no hours, no day of the month, no math, no idea of the week then after that. 68 00:04:48,740 --> 00:04:49,230 Yes. 69 00:04:49,410 --> 00:04:50,730 And I'm going to copy. 70 00:04:51,870 --> 00:04:53,050 This year. 71 00:04:54,750 --> 00:05:02,520 The bath of the Dutch command, because we need to use that in order to update the timestamp of what 72 00:05:02,820 --> 00:05:04,480 space defiled. 73 00:05:05,490 --> 00:05:08,800 Slash ATC, slash past W.D.. 74 00:05:10,460 --> 00:05:17,470 So as we can see here, this is the current job that we need to add and duck, and it takes a detour 75 00:05:17,490 --> 00:05:18,440 or and. 76 00:05:20,410 --> 00:05:23,510 And and the current top for this current user. 77 00:05:23,520 --> 00:05:27,610 So I'm going to see if Kobe could be this one first. 78 00:05:28,700 --> 00:05:30,710 I'm going to do it this year. 79 00:05:31,460 --> 00:05:34,880 And I'm linked to the to the editor of this. 80 00:05:35,300 --> 00:05:40,460 I'm going to tap the crown tap dash e because I want to do it with the current user. 81 00:05:41,620 --> 00:05:43,220 Wrote down a hit enter. 82 00:05:44,700 --> 00:05:47,620 As you can see here, just is that exterior, it takes a bit to read. 83 00:05:47,670 --> 00:05:51,660 Now, I have to add, I then I'm going to paste it. 84 00:05:53,330 --> 00:06:00,640 Then I'm going to save the file, it's enter right now and installed. 85 00:06:01,010 --> 00:06:01,640 Perfect. 86 00:06:03,350 --> 00:06:11,150 So now if I would like to view the current tab for this current user, so I'm going to tap current tab 87 00:06:11,150 --> 00:06:12,530 Dashiell hit enter. 88 00:06:12,620 --> 00:06:20,720 As we can see here, we have a new cron job and Kuratov for this current user. 89 00:06:21,710 --> 00:06:30,860 Now, the next question, I'm going to show the structure of their current tab entries or the Crown 90 00:06:32,220 --> 00:06:34,640 tab now is the next question. 91 00:06:34,700 --> 00:06:36,320 If I would like to run. 92 00:06:38,120 --> 00:06:47,720 Every day on the midnight that deletes all the text files that t x, t, the T X, T fives under the 93 00:06:47,720 --> 00:06:50,810 slash home slash student. 94 00:06:50,840 --> 00:06:52,190 So how I'm going to do that. 95 00:06:52,670 --> 00:06:54,370 And also, I want to do it. 96 00:06:54,380 --> 00:06:54,980 For what? 97 00:06:55,190 --> 00:06:56,150 For the user. 98 00:06:56,210 --> 00:06:58,580 Student, not for this user. 99 00:06:59,420 --> 00:07:01,310 I can't do it through here. 100 00:07:01,310 --> 00:07:04,200 Or I can go to the to the user, stand with them. 101 00:07:04,250 --> 00:07:05,300 But I will do it from here. 102 00:07:05,840 --> 00:07:08,870 So now the the question of your run every day. 103 00:07:09,650 --> 00:07:12,030 So if we're out every day on midnight. 104 00:07:12,950 --> 00:07:14,470 So there is nothing for the minute. 105 00:07:14,570 --> 00:07:22,340 We going to if it's in the midnight, so the midnight will be zero and our will be zero. 106 00:07:22,740 --> 00:07:25,370 So we'll be zero zero because it's a midnight. 107 00:07:26,390 --> 00:07:31,070 Then there is nothing about the day of the month. 108 00:07:31,100 --> 00:07:32,800 So I'm going to leave it devilled star. 109 00:07:33,050 --> 00:07:35,260 And there is nothing about the month star. 110 00:07:36,800 --> 00:07:37,640 Then there is nothing. 111 00:07:37,670 --> 00:07:40,070 Also about the day of the week. 112 00:07:40,280 --> 00:07:42,000 So I'm going to start here. 113 00:07:44,420 --> 00:07:46,970 Then the next, think what they want to do. 114 00:07:47,570 --> 00:07:52,190 I want to know what is the bath of dad remove comment. 115 00:07:52,640 --> 00:08:01,440 So there bath is you is the user slash Ben, then slash r m. 116 00:08:01,810 --> 00:08:07,280 And also I'm going to add a recursive and also the force here with it. 117 00:08:07,950 --> 00:08:13,900 Space because I would like to remove and delete all the T 60 files. 118 00:08:14,430 --> 00:08:22,490 And under this, under the the home directory for the for the user student. 119 00:08:22,790 --> 00:08:23,670 As you can see here. 120 00:08:24,330 --> 00:08:27,050 So slash home slash student. 121 00:08:27,500 --> 00:08:29,540 Let's review the current job here. 122 00:08:30,050 --> 00:08:31,850 So I run every day. 123 00:08:35,250 --> 00:08:41,650 Midnight saw the minute since it's midnight, so the minute would be zero and I will be zero. 124 00:08:41,679 --> 00:08:46,860 Day of the month will leave its star and the month is start. 125 00:08:46,860 --> 00:08:48,660 And there is nothing that we need to either. 126 00:08:48,720 --> 00:08:50,610 And the day of the week start also. 127 00:08:51,000 --> 00:08:53,210 Then we need to add the bath of the command. 128 00:08:53,220 --> 00:08:58,840 So slash use our then slash bean slash r m. 129 00:08:58,980 --> 00:09:04,010 This is the command and I'm going also to add dad option dash r. 130 00:09:04,620 --> 00:09:06,660 And if I'm going to copy this. 131 00:09:09,320 --> 00:09:09,730 Kobe. 132 00:09:11,930 --> 00:09:18,380 And also, I'm going to delete it just to make sure that we have the right comment. 133 00:09:19,380 --> 00:09:19,860 Perfect. 134 00:09:20,010 --> 00:09:22,400 We have direct command here and the bath water. 135 00:09:23,300 --> 00:09:23,620 All right. 136 00:09:24,180 --> 00:09:27,660 Now, ever since I'm going to do it for the user straight into it, I'm going to do. 137 00:09:28,320 --> 00:09:38,770 I'm going to type on top and dash you student then dash e because I would like to add Disgruntle or 138 00:09:38,820 --> 00:09:39,600 the crunch up. 139 00:09:41,580 --> 00:09:43,500 To the users stood hit, enter. 140 00:09:43,790 --> 00:09:53,430 And I'm going to test the current job over here and I'm going to save the five hit enter. 141 00:09:54,460 --> 00:10:02,320 Now I'm going to double check that they do have the Chron tab for the user student dash l. 142 00:10:03,190 --> 00:10:07,700 It entered, as we can see here, we have the cron job for the user. 143 00:10:08,420 --> 00:10:15,710 Student who would like to get more information about about the command Dacron tab. 144 00:10:15,790 --> 00:10:19,150 We can go to the Manbij and we can get more details. 145 00:10:19,390 --> 00:10:23,430 And also the options that we can use with the on tap. 146 00:10:24,040 --> 00:10:25,420 That's conclude our session. 147 00:10:25,810 --> 00:10:26,290 Thank you. 148 00:10:26,380 --> 00:10:27,720 And see you on the next lesson.