LINUX system log clearing

  
                  

Commonly used log files are as follows:

access-log records HTTP/web transmissions

acct/pacct records user commands

aculog records MODEM activities

btmp record failed record

lastlog records the last few successful login events and the last unsuccessful login

messages log information from syslog (some links to syslog files)

sudolog records commands issued using sudo

sulog records use of su command

syslog records information from syslog (usually linked to messages file)

utmp records each user currently logged in

wtmp A permanent record of each user's login entry and exit time

xferlog records FTP session

Direct delete log:

1. Delete all logs: find/var-typef-execrm-v{}\\; (the last semicolon is also part of the mandatory command)

2. Set /etc/logrotate.d The /syslog file controls the size of the log file.

3. If you really want to manually empty some log files, you can use the command: >/var/log/message. The function of this command is to empty the contents of the file message. You can also add this command to the cron task.

linux detailed log parsing:

The unix system log files are usually stored in the "/var/logand/var/adm" directory. Usually we can look at syslog.conf to see the log configuration. Such as: cat /etc /syslog.conf

where sunos is under /var/log and /var/adm. There is /usr/adm for /var/adm link.

Redhat is in /var/log and /var/run.

Below is a sample of the logs in sunos5.7.

#ls/var/adm

acctlogmessages.1passwdsulogvold.log

aculogmessagesmessages.2sautmpwtmp

lastlogmessages.0messages.3spellhistutmpxwtmpx

# Ls/var/log

authlogsyslogsyslog.1syslog.3

sysidconfig.logsyslog.0syslog.2syslog.4

The following is a sample of the logs in redhat6.2.

#ls/var/log

boot.logdmesgmessages.2secureuucp

boot.log.1htmlaccess.logmessages.3secure.1wtmp

boot.log. 2httpdmessages.4secure.2wtmp.1

boot.log.3lastlognetconf.logsecure.3xferlog

boot.log.4mailllognetconf.log.1secure.4xferlog.1

cronmaillognetconf.log .2sendmail.stxferlog.2

cron.1maillog.1netconf.log.3spoolerxferlog.3

cron.2maillog.2netconf.log.4spooler.1xferlog.4

cron. 3maillog.3newsspooler.2

cron.4maillog.4normal.logspooler.3

daily.logmessagesrealtime.logspooler.4

daily.shmessages.1sambatransfer.log

#ls/var/run

atd.pidgpm.pidklogd.pidrandom-seedtreemenu.cache

crond.pididentd.pidnetreportrunlevel.dirutmp

ftp.pids-allinetd. Pidnewssyslogd.pid

Generally, the logs we want to clear are

lastlog

utmp(utmpx)

wtmp(wtmpx)

messages

syslog

************************************* ************************************************** **************

Copyright © Windows knowledge All Rights Reserved