That's cool, but what practical applications does it have? Well, one of them
you can actually see in the example here, you can actually keep a backup updated. This is gonna run
5 a.m. every week on Sunday, or Monday, and it's going to basically do this, it's
going to create a tar archive, here. So, it's going to store in "/var/backups/home.tgz"
and the contents of it is going to be the entire home directory. So, it's
going to make an entire back up once a week, of all your files. So, that's
pretty useful. I want to give you guys one more example of how crontabs can
be used. So, I'm going to exit out of here, and what I'm gonna do now is, so when we just
did that we set up, the reason why it output my home directory for the "ls"
command
is because we created that crontab as our user, and so if we wanted to run a
command you know in a crontab that required elevated privileges, in order to
do that we actually type "sudo crontab -e" and this will open the crontab file
for the root user. So, if we scroll down,
perfect. So, let's set up a command. So, I'm gonna run this at "0 7" a.m., every day of the
month, every month, and on Monday. So, Monday morning at 7 AM this is gonna
run. "apt-get upgrade -y"
So, the "-y" flag in the "apt-get upgrade" basically means say yes to
everything. So, this command is going to keep my system updated every week, at 7 a.m.,
on Monday. So, this this is great for scheduling tasks if you need certain
things to run at certain times, or so frequently you can do that using crontab. I
hope you guys enjoyed that. I'm really excited because in the next module
we're going to get to talking about developer things, and so we're going to
go over different development environments, and technologies, and stuff,
so it's really exciting. Thanks for watching and I'll see you guys next time.