Hello and welcome to this video on System Configuration on Oracle Linux 8.
In this video, we will cover Oracle Linux 8's Date and Time commands.
For our objectives today and after viewing this video, you should be able to:
Describe configuring system date and time during installation
Describe configuring system date and time by command line
Explain the timedatectl utility
And lastly you will be able to explain configuring Network Time Protocol using chrony.
For configuring system date and time, you can enable and configure Network Time Protocol
during installation.
However, you need to set up networking first if you want to use Network Time Protocol.
Network Time Protocol provides a method of verifying and correcting your computer's time
by synchronizing it with another system.
Assuming you are connected to a network, you can enable Network Time Protocol by moving
the Network Time switch to the ON position.
You can then click the configuration icon, located next to the Network Time switch, to
set the date and time by using Network Time Protocol.
Oracle Linux has three command-line utilities to configure the system date and time: the
date command, the hwclock command, and the timedatectl command, which comes with systemd.
Use the date command to display or set the system date and time.
Run the date command with no arguments to display the current date and time.
You can also display the time and date in the future or in the past.
For instance, to display the date one year from now use the -d option and "1 year".
You can run the hwclock command to display or set the hardware clock date and time.
In addition, you can sync the hardware clock with the system time or vice versa.
Oracle Linux offers another utility to configure and display date and time information which
is the timedatectl.
This utility is part of the systemd system and service manager.
Running timedatectl with no arguments displays:
Local time
Universal time
RTC time
Time zone
Network Time Protocol (NTP) configuration
And Daylight Savings Time (DST) information
The utility allows you to:
Change the current date and time
Set the time zone
Enable automatic synchronization of the system clock with a remote server
Chrony is a suite of utilities that provides another implementation of Network Time Protocol.
Chrony is designed for mobile systems and virtual machines that are often powered down
or disconnected from the network.
Systems that are not permanently connected to a network take a relatively long time to
adjust their system clocks with the Network Time Protocol daemon, ntpd.
The main configuration file is located in /etc/chrony.conf and are similar to those
in /etc/ntp.conf.
Chrony consists of chronyd, a daemon that can be started at boot time, runs in the background,
and makes necessary adjustments to the system clock.
Chrony also includes chronyc, a command-line utility used to monitor performance and make
changes to operating parameters during run time.
The chronyc utility provides a command prompt and several commands such as tracking for
displaying system time information and sources for displaying information about current sources.
Run the date command with no arguments to display the current date and time.
Run the date command with the argument +%A to view the weekday name.
Run the date command with the argument +%B to view the full month name.
Use the date command to change the date to another date using the +%D -s options and
the new date.
Substitute today's correct date.
The example changes the date to 25th September, 2018.
Use the date command to change the time to the correct time by adding the +%T%p -s options.
The example changes the time to 4:14 PM.
Use the timedatectl command.
Run the timedatectl command with no arguments to display the system date and time information.
You can disable ntp by running the timedatectl command with set-ntp 0 as arguments.
Use the timedatectl command with the set-time argument to change the date to another date
(for example, 19 November, 2015).
You can substitute any date.
Use the timedatectl command and set-time argument to change the date to the correct date.
Use the timedatectl command to change the time to the correct time.
Substitute the current local time and enter the hour using a 24-hour clock.
Run the timedatectl command afterwards with no arguments to verify that the time changed.
Use the copy command to make a backup copy of the /etc/chrony.conf file.
Next, use the systemctl command to start the chrony daemon, chronyd.
Run the chronyc -n tracking command to check chrony tracking.
The "n" option provides numeric host address output
Run the chronyc command and sourcestats with the verbose option -v.
After watching this video, you should now be able to:
Describe configuring system date and time during installation
Describe configuring system date and time by command line
Explain the timedatectl utility
And lastly you should now be able to explain configuring Network Time Protocol using chrony.
Oracle provides an extensive number of resources which you can use to learn more about this
subject and others.
Look for additional videos on the Oracle Linux 8 boot process covering GRUB2, systemd and
other Linux boot process topics.
This concludes this video.
Thank you for watching.