Full Linux Sysadmin Basics Playlist:

Check out my project-based Linux System Administration course (free sample videos):

Official Site:
Twitter:
Facebook:

About this Video:

A quick introduction to cron for people who want to manage scheduled and recurring tasks on Linux systems. This is useful for system administrators, developers/programmers, and everyone who wants to do things like

– occasionally cleaning out old files
– removing development clutter
– scheduling things on servers or other remote machines
– If you have something more exciting, leave it in the comments and I’ll put it here :-D.

We also touch on slightly more advanced topics such as security considerations and cron.{allow,deny}

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

44 Comments

stillFLiP

May 25, 2020

At some point I'll automate so many things on my computer that I'll have no reason to sit in front of it anymore.

Reply

hell725

May 25, 2020

how do I get crontab to work? when I enter "crontab -e" or "cronta -l" I get the same message -> "bash: crontab: command not found" anyone can help me?
my OS is Endless OS

Reply

chescarino

May 25, 2020

thank you

Reply

Hamster Go

May 25, 2020

What if the system is powered off?

Reply

Luis Gonzalez

May 25, 2020

Thanks!

Reply

The Programming Channel

May 25, 2020

thank you! this was very helpful! 🙂

Reply

The Programming Channel

May 25, 2020

thank you! this was very helpful! 🙂

Reply

N igger

May 25, 2020

15 Windows10 users disliked this video

Reply

zainuddin brahim

May 25, 2020

thanks dave has refresh me on this i am about to take on a phone interview

Reply

Robert Manly

May 25, 2020

Can anyone help with where I can find the man command for the description of the crontab entry format and field values etc?

Reply

Josbell_

May 25, 2020

How do I make this work with the "rtcwake", I want to set my pc to turn-on and run a youtube video as a wake-up… pretty much as an alarm.
It does work when I set to sleep such as -m mem, but when I set it -off and try to wait -60 seconds for the pc to turn-on it doesn't.
So I was thinking if I use crontab to make it work after I make it turn-on in a specific time with RTC.

Reply

Kowalito

May 25, 2020

Awesome tutorial man, I learned a lot, keep up doing marvelous work!

Reply

Kosteri x

May 25, 2020

7:30 the [a-b] thing is useful. Also the */1 => every minute. Well explained the greedy thing ("OR")

Reply

BravoEchoAlphaRomeo

May 25, 2020

bit rusty, my last cronjob was '99. thanks for the refresher.

Reply

Manikandan U

May 25, 2020

Thanks Dave 🙂

Reply

Comp sec

May 25, 2020

Hi Guys, what's this Linux distribution Dave is using in this Video? I'm far new in this linux stuff. I Think it's a distribution with GUI with an opened terminal? At work, there always Core Editions, no GUI. So it looks quite different 🙂 Thanks in advance.

Reply

L

May 25, 2020

how did you manage to hide your user@machine prompt ?

Reply

Daniel Cory

May 25, 2020

I've been trying to figure out how to do system crons. Thanks!

Reply

Grand Fiore

May 25, 2020

The day you think you've come up with something cool and it doesn't work …

➜ ~ crontab -l
SHELL=/usr/bin/zsh
* * * * * cmatrix -ab -C yellow

Why!?!?

lol

Reply

Tiku Tiku

May 25, 2020

Great video…..Do you have any videos on scheduling backup jobs?

Reply

Cust F

May 25, 2020

Awesome Thank you!!

Reply

Rogelio Amezquita

May 25, 2020

Great video! So I want to schedule my home server to shutdown at 10:00 PM Sunday through Thursday, and leave it running Friday and Saturday. I know that 00 22 * * * root poweroff, what do I put for the third star?

Thank you,

Rogelio

Reply

Filipp Bavelsky

May 25, 2020

Hi Dave, nice video! But you forgot to mention one important thing: you can use crontab to run things on boot simply by writing "boot" instead of the time specs in the beginning of your crontab command. Just a detail worth sharing I think… 🙂

Reply

Moe Almasri

May 25, 2020

hey Dave!! quick question/clarification! does the number '1' represent monday? and if it does, wouldnt it make more sense if it represented sunday?? thanks brother

Reply

Denis A

May 25, 2020

10x

Reply

syvixay vilaychit

May 25, 2020

Great video
man

Reply

Mayukh Sarkar

May 25, 2020

I have a process supervision going on at my server. It restarts the process automatically if it fails. But I want it manually start and stop it using

“`sv start example“`

and

“`sv stop example“`

based on time of the day..should I use cronjob or there is any internal tool to do this. I am using “`runit“` as process supervision tool.

Reply

Incognito12000

May 25, 2020

Thank you for these videos!! You've been a tremendous help. I like your teaching style.

Reply

komal Pharate

May 25, 2020

Hi..Your tutorial is very helpful.
I have one doubt. I want to run script.sh file :
script.sh
which I want to execute after every 15 min.
But Im confused about the path we have to mention in crontab file next to the time constraints.
Im trying:

15 * * * * /home/username/projectfolder/script.sh
 Can you help please?

Reply

Pixelles

May 25, 2020

Thanks for the video, been struggling to find a video explaining in simple terms how to schedule a cron job. Finally have a basic understanding of cron and when the different cron config files are used! 🤓

Reply

Jesús Costas

May 25, 2020

Hi, I have a question, if you modify /etc/crontab, This file affect to
all the system users?. For example If I call a custom script with a
message, from /etc/crontab the message will appears in all users
accounts, and how can I do it?. Because from root account using crontab
-e root can I affect to all user accounts in my computer, using a script
with message?. For example I login to an account and the script's
message appears then I login to an other account and the script's
message also appears, how can I do it this?.

Reply

Miiro8

May 25, 2020

Can you lett me know how can I run my script every 45 second ?

Reply

Yousef Elsayed

May 25, 2020

Great video.

Reply

Mohamed Serag

May 25, 2020

The sysadmin videos are amazing man, and this too.

Reply

johnr17033

May 25, 2020

Once you create a crontab file, suppose for some reason you do not want it to run. Do you rename the file? Delete it? Edit it and # out the lines?

Reply

Steven Smith

May 25, 2020

Thanks for the video, full of useful information.

Reply

AC 7

May 25, 2020

Hey Dave… I love you videos.. theyre very helpful…. I do have a question… i've seen all you videos on this playlist and you keep saying users…. i have very little experience with linux… to be specific, only you're videos… but what do you mean users? like users from other machines? or from the same machine? can any user be root by simply adding sudo to a command?

Reply

Mohamed B.

May 25, 2020

http://cron.nmonitoring.com/cron-generator.html
is an online tool  very usefull to generate crontab tasks

Reply

Kerrigan

May 25, 2020

why are you running your VM from Windows?

Reply

Guntis Feelgoods

May 25, 2020

Nice explanation of different ways to use cron.

Reply

croquagei

May 25, 2020

Hi there.  Great videos.

A quick question.

Min    Hour    DayOfMonth    Month    Weekday
30    18    1,2,3,4,5,6    *    5

If this creates a job to run at 6:30pm on day 1-6 of the month AND every friday.

Say i want to run a weekly backup at the end of the work week.  How would i write a job to perform at 6:15pm in any month and ONLY on friday?  

30    18    ?    *    5

Reply

Sheldon Rupp

May 25, 2020

Dude, keep up the good work. I love your videos, their either kinda funny and super helpful or super serious and super helpful! Can't thank you enough for your videos!

Reply

smillal

May 25, 2020

Awesome! Thank you! 🙂

Reply

richard33043

May 25, 2020

Dave you should think about teaching. I have learned so much from your videos. Thank you!

Reply

Leave a Reply