RackNerd Billboard Banner

How To Use Logrotate For Managing Log Files In Ubuntu Linux

This video will show you how To Use Logrotate For Managing Log Files In Ubuntu Linux. To conserve disk space and keep the system operating efficiently, Logrotate is a software program found in Unix/Linux systems that controls the automated rotation, compression, and deletion of log files.



Commands:
sudo apt update
sudo apt install logrotate
logrotate –version
cat /etc/logrotate.d/apt

sudo vim /etc/logrotate.d/my-app

/var/log/my-app/*.log {
daily
missingok
rotate 14
compress
notifempty
create 0640 www-data www-data
sharedscripts
postrotate
systemctl reload my-app
endscript

}

sudo logrotate /etc/logrotate.conf –debug




Chapters:
0:00 Intro
0:23Check The Logrotate Version
1:02 Take a closer look at the Logrotate configuration
1:23 Creating an Example Configuration
2:45 End screen




What you’ll learn:
1. Check The Logrotate Version
a. How to update your package list and get the package logrotate if you need to install it
b. How To confirm the installation of the system utility
c. How to ask for Logrotate’s version information
2. Take a closer look at the Logrotate configuration
a. How you can find information about Logrotate’s setup on Ubuntu
b. How to see what’s inside the /etc/logrotate.d.cat configuration file for a particular file for the apt package utility
c. How to provide configuration blocks for the term.log and history.log log files located in the /var/log/apt directory
3. Creating an Example Configuration
a. How to Open a new file in the /etc/logrotate.d directory using vim or your preferred editor
b. How to add a setting for the my-app log files
c. How To save and quit vim
d. How You can test the config file
e. How to activates debug mode, invokes logrotate, and specifies the standard configuration file



















Song: Pierse – It Breaks My Heart
Music provided by Vlog No Copyright Music.
Video Link: https://bit.ly/3L4uXRy

#computereverywhere #howtouse #files #ubuntulinux #log

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

RackNerd Billboard Banner
0 Shares
Copy link