Linux Workshop Day - 5

Hello people, welcome back to the new blog!!

This blog demonstrates the two concepts that are easy to understand and are listed below:

• Logs

•YUM and RPM (yum and rpm)

• Cron

Let us start now with Logs:

Logs:

Logs in Linux refer to records or files that store information about various events, activities, and system messages occurring on the operating system.

Log files are typically stored in the /var/log directory.

Rsyslog

1. It combines all logs and segregates them into different logs.

2. These logs include :

- kernel

- cup

- boot

- yum

- demessage

- fail

- cron

- secure

- message

- mail

- xorg

- wtmp

The command

Syntax-

facility priority /var/[filename].log

is a representation of the log in which

facility - mask/user/auth/authpriv and

priority - info/notice/err/debug/critical/panic/alert

In Linux, the command cd

Syntax-

cd /etc/rsyslog.d/

is used to change the current working directory to the location where the rsyslog configuration file is stored.

Logrotate - Logrotate is a utility in Linux that is used to manage and control log files. It involves the compressing and archiving processes. Every week logs are stored as backup.

The general ctl is responsible for the collection of data of logs.

YUM & RPMYUM and RPM are the package installer in Linux.

YUM :

YUM stands for "Yellowdog Updater, Modified".

It is a high-level package management utility.

When you request to install or update a package, Yum checks for and installs any required dependencies as well

Yum fetches packages from software repositories.

RPM:

Stands for RPM Package Manager.

It contains software binaries, libraries, and configuration files.

It allows users to easily install, upgrade and remove software packages using the command line.

There are more complex commands that are confusing.

It works offline using pre-downloaded rpm files.

It relies on the user to resolve dependencies manually.

Cron

  1. It is a scheduler.

  2. It actually schedules the things that need to happen.

  3. Some commands-

    • crontab -l

      It is used for listing the cron jobs.

    • crontab -e

      It enables us to edit a cron job.

  4. Syntax representation-

    • minutes[0-59] hours[0-23] date[1-31] month[Jan,Feb,etc] day[0-6] command

    • Example: 15 15 15 echo "$(date)" >> /tmp/abc

      The above example demonstrates that in all months on the 15th date at 3 hours and 15 minutes in pm, the system will run the echo command mentioned.

That's it for Day 5.