Hey, boys and girls, in this video, we're going to cover the new system utility come in and that
as time date to settle all one word or you could be pronounced as time date control command.
The command is a new utility for Rel, which is Red Hat enterprise level and CentOS seven or eight based
distributions, which comes as a part of system DX system or service manager.
It is a replacement of old traditional day command, which we learned earlier.
So Date Command and the time day TTL Command both exist right now in the systems, but eventually in
the later version, it will be completely replaced with time date Ctrl Command.
So it's better that we start learning from today.
The time date CDL Command will query or show change your date, time and time zones off your system
clock.
It synchronizes the time with A.P. server as well, so you could either use Cron ID, which is a demon
that you need to have your clock synchronize, or the older daemon, which is for the anti PD.
You could use either the service and then end the time date Seitel with the different options you could
set to as yet.
So we'll look it up to these two demons, or you can use a newer daemon, which is System D Dash Time
sync the daemon to synchronize time, which is a replacement of Notepad and cron edi.
So you have to, of course, have to have that new daemon.
This new daemon is a very lightweight.
It doesn't offer a lot of different features that Cron ID or Anti PD has to offer, but it does the
work.
So one thing you need to keep in mind and please note, please remember the Santos and Red Hat.
Neither one of them does not provide this daemon and a standard repo, meaning if you download it or
install Santos or Red Hat but gooey, you will not see that System de dash times sync daemon in your
packages, you will have to download it separately.
So in this video, we're not going to go and download this system d time sync daemon.
We will just cover that time date Ctrl Command and we will see how we could use that command to synchronize
with our scrawny D..
All right, so let's do some lab exercise and run this comment in our Linux environment.
So the very first thing we have to do is to check the time status we have to run the command time date
Ctrl.
You can run just by itself or the command, followed by status.
So I have my Linux machine open.
By the way, I have both machines a Red Hat eight and CentOS seven, so I have both versions, so this
one is sent seven.
So I could run the command time date Ctrl and it will give you that information.
Local time Universal Time RTC Time Time Zone is A.P. enabled?
Yes.
Is anti-peace synchronized?
No.
So DST active time next DST it gives you a whole bunch of information.
If you do the same thing with, ah, version eight date time Ctrl.
Sorry.
Time data.
Give you a local time Universal Time Time Zone system clock synchronized, no A.P. service active.
Now it's inactive, so why it is inactive will figure it out as we move on.
So, so right now, let's move on and then the next command to view all available time zones that you
have in the system.
You could just simply do time date, KTL list dash time zones and it will give you all the time zone.
You just have to hit the space bar and it will keep going.
And if you want to get out, just simply hit queue.
Same thing with our version eight time date Ctrl.
List time zones, and it gives you all the time zones.
Then next thing is if you wanted to set the time zone at differently.
So right now my time zone is set to let's check again is said to America and New York.
That's where I am.
That's where I live.
So my time zone is set perfectly.
If you want a change or if you see you have a wrong time zone, you could set it by simply running this
command time date that'll set Dash Time Zone and then put double code America Slash in New York.
If you do not know the right spelling or exact spelling of your time zone again again, you can run
the command time data list time zones.
Our next one is if you want to set the time or change the time, you could just simply run time date,
Ctrl set Dash Time and then your month and date.
And this is four if you only wanted to set the date.
If you remember in in the previous comment in the date, you will use the command date with the minus
s option, which is to set the time or or the date to set the date and the time.
Together, you have to run the command the same command set time and give it the entire parameters,
which is the year, month day.
And then if you are using if you're doing 24 hour format, then you have to specify the twenty four
hours format hour.
Then the minute and then the second.
Then to start automatic time synchronizing with a remote A.P. server, you have to set the A.P. true
and then you have to check the status.
So let's go right now and see if you have A.P. set.
So right here it says A.P. enabled.
Yes, but A.P. is not synchronized.
It means maybe our current D is not running.
But first, we need to find out whether we have Granny D or A.P. running.
So for that, we have to do a system CTL status and TPD and you run it and says A.P. de Dot service
could not be found.
OK, it means it's not installed and not running.
Now let's try Granny D and we'll see.
Yes, it is installed, however, and OK, it is installed and it is active and it is running.
So what we have to do is let's restarted.
So it gets synchronized with our time, date command, and it says A.P. synchronized, it says yes,
sorry, no.
So how do we have to make it synchronized?
We could try time, data set and tape.
True.
OK, now let's run the time dates.
It'll come in without stats or of its status doesn't matter.
And there it is.
You see, A.P. is now synchronized because we have enabled it and set it to true.
So now it's looking for that time with current I.D..
Similarly, if you go to our version, eight time date Ctrl.
This command or status, both same commands, it doesn't really matter, let's clear the screen to OK,
now you see system clock synchronize now.
So we will do is before we synchronize, we have to make sure Cron or Antipodes service either one is
running the world check system CTL status first.
A.P.B.
OK.
The service is not there, not even installed.
OK, let's check Chronique De.
OK.
It is inactive.
OK, it is installed.
However, it is an active, so first of all, what we will do is we will enable it so it could start
at boot time and then we could.
Start that chronic.
OK, now it has started, let's Iran.
Time, date, command to see if it automatically synchronize to it.
OK, it says system clock synchronized, however, the A.P. service status is.
Oh, it is active.
Beautiful.
If you don't see this active, then what do you have to do?
Simply run that command at time date Ctrl set.
Dash A.P. to true.
And then you do time date Ctrl and it should show here.
Yes.
And active.
I'll see you in the next lecture.