Preserve System Journals

LinuxLinuxBeginner
Practice Now

Introduction

As a system administrator, it is crucial to understand how to properly manage and maintain system journals, which store valuable information about the system's activities and events. In this challenge, you will learn how to operate a running system and preserve its system journals, a key skill required for the RHCSA exam.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/BasicSystemCommandsGroup(["`Basic System Commands`"]) linux/BasicSystemCommandsGroup -.-> linux/echo("`Text Display`") subgraph Lab Skills linux/echo -.-> lab-389471{{"`Preserve System Journals`"}} end

Manage System Journals

Tasks

  • Task 1: Explore the contents of the system journal using the journalctl command.
  • Task 2: Limit the size of the system journal by setting the appropriate configuration.
  • Task 3: Rotate the system journal to prevent it from growing too large.

Requirements

  • Perform all operations as the labex user, who has sudo privileges.
  • The default working directory is /home/labex.
  • Use the journalctl command to interact with the system journal.
  • Modify the system journal configuration file located at /etc/systemd/journald.conf.
  • Ensure the system journal size does not exceed 100 MB.

Example

After managing the system journal, you should be able to see the following output when running journalctl --list-boots:

-1 2023-04-12 10:00:00+0000
 0 2023-04-12 10:01:00+0000

The system journal has been rotated, and the size is now limited to 100 MB.

Summary

In this challenge, you learned how to manage the system journal on a running Linux system. You explored the contents of the journal using the journalctl command, limited the size of the journal by modifying the configuration file, and rotated the journal to prevent it from growing too large. These skills are essential for system administrators to maintain the health and performance of their Linux systems, and are a key part of the RHCSA exam.

Other Linux Tutorials you may like