[nmglug] saving disk space

Mars DeLapp jmdelapp at delapp.com
Tue May 22 23:07:59 PDT 2007


BrianO'Keefe wrote:
> A quick and easy one-
> Is it safe to delete /var/log files? I would assume it is but I wanted
> to get some expert advice.

In some cases it is NOT safe to delete log files. The risk comes from the 
possibility of the log file getting recreated with the wrong permissions and 
allowing everyone read access. "it might be a security hole if everybody is able 
to read auth.* messages as these might contain passwords."

You could install logrotate

logrotate normally runs as a cron job at 6:25 am for your standard daily cron 
jobs. If you have your computer on at that time, it runs. If you don't have the 
box on, it will not run. I noticed on this particular box of mine, the last time 
I was working at 6:25 am was in February.

You can run logrotate by hand:

# logrotate -fv /etc/logrotate.conf

But really, the first thing you should do is go look at that huge log file and 
find out what is going on. You should use 'tail' for looking at big huge 
multi-megabyte log files.

# tail -n100 /var/log/biglogfile.log

Mars

-- 
=============================================================
J. Marsden DeLapp, PE
President
DeLapp & Associates, Inc. dba DeLapp Engineering.
Providing lighting and power planning, design and analysis services
for commercial, industrial and large residential facilities.
1190 Harrison Road Ste 3a
Santa Fe NM 87507
(505) 983-5557
http://DeLapp.com
=============================================================




More information about the nmglug mailing list