Sundaramurthy Blog

March 20, 2010

How to clean-up linux /var directory

Filed under: Linux — sundar5 @ 1:09 am

steps:

1. Take copy of the /etc/logrotate.d/syslog file.

# cp -p /etc/logrotate.d/syslog  syslog_old

2.  Insert /var/log/all into syslog file

/var/log/messages /var/log/all /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

/var/log/secure {
create 0600 root
}
3. run following command as root

#/usr/sbin/logrotate -f /etc/logrotate.d/syslog

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: