system logs management UBUNTU 8.10-64

Asked by WacoJohn

Linux beginner/noob. Just browsing around the desktop and came across System/Administration/System Log. I quickly realized these accumulate. I am too new to understand much of what they say, but being disk space concerned wonder how the logs are managed.

Googled 'manage system log files linux' and came across http://articles.techrepublic.com.com/5100-10878_11-1052474.html (Dec 27, 2000) which looks 'good to me', but still way over my head. I also told myself there may be some other management scheme in place by default.

Could someone please comment on this distro's log management routine or what I should do to control their accumulation?

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Alex Rybicki
Solved:
Last query:
Last reply:
Revision history for this message
Alex Rybicki (alex-rybicki) said :
#1

it should be safe to delete periodically the log files listed in the system log if you feel that you need to. you will need root access to do this.
personally though i checked my /var/log/ directory, and am only up to 50MB, after a few years of logs.

Revision history for this message
Best Alex Rybicki (alex-rybicki) said :
#2

to see the actual size of the logfiles:
sudo du -sh /var/log

to delete them:
sudo rm /var/log/*.gz; sudo rm /var/log/*.log

Revision history for this message
WacoJohn (johnbooth) said :
#3

A sincere thank you for the info. I notice in /root/etc there is a folder named logcheck and another named logrotate.d and a file logrotate.conf; both of which are referenced in that Tech Republic link I googled. This implies that there is some kind of management going on by default, especially with the contents of logrotate.cnf looking like the following. I am concluding the situation IS already 'Managed'. Thank you again. :

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here

Revision history for this message
WacoJohn (johnbooth) said :
#4

Thanks Alex Rybicki, that solved my question.