LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Log file configuration (http://www.linuxquestions.org/questions/slackware-14/log-file-configuration-4175453546/)

andy_o 03-10-2013 06:29 PM

Log file configuration
 
Hi,

I have just newly installed Slackware, decided I wanted to learn a bit about how linux works, rather than just dumbly use it, and figured this would be a good distro to try that.

Anyway, my question is, after a default Slackware installation are there any config settings I should make to prevent log files from eating up my hard drive? For example, do I need to specify anywhere "don't let logs get bigger than x" or is this automatically taken care of somewhere? Or should I not worry?

Thanks for any help.

markush 03-10-2013 06:52 PM

Hi,

don't care about the logfiles, it is configured very well on a stock Slackware-installation.

Markus

andy_o 03-11-2013 05:15 AM

Thanks markush, nice to know that I don't need to worry about it.

wildwizard 03-11-2013 05:30 AM

I know of only 2 situations where the logs files get out of control.

1. Hardware faults that get logged continuously (fix the hardware)
2. Copying firewall scripts that log everything (The Internet is a nasty place logging all of that is a waste of time on your home computer)

GazL 03-11-2013 06:12 AM

There are some jobs in root's cron entry that run overnight, one of which (logrotate in cron.daily) manages log files. If you don't leave your machine on, then you might want to change those times so that they will run at a time when you system is actually running.

markush 03-11-2013 06:19 AM

Quote:

Originally Posted by GazL (Post 4909055)
There are some jobs in root's cron entry that run overnight, one of which (logrotate in cron.daily) manages log files. If you don't leave your machine on, then you might want to change those times so that they will run at a time when you system is actually running.

For these jobs one can use anacron which is available at slackbuilds.org http://slackbuilds.org/repository/14.0/system/anacron/

Markus

GazL 03-11-2013 06:38 AM

...if you can be bothered to install an additional cron daemon. I find it easier to just change the time, but you're right. anacron might suit some people better. :)

qweasd 03-11-2013 09:36 AM

If you ever make your own logs, rotating them is easy. One way is to use logrotate. For example, I have daily mirror logs dumped in /var/log/mirrorme.log and /var/log/mirrorme-error.log, so I make a new file in /etc/logrotate.d/, call it whatever, and put something like this in it:
Code:

/var/log/mirrorme.log {
  rotate 0
  ifempty
  daily
  mail melikamp
}

/var/log/mirrorme-error.log {
  rotate 0
  notifempty
  daily
  mail melikamp
}

logrotate is run daily from /etc/cron.daily, so this setup mails me the log and zeroes it daily. You can see man logrotate and whatever you have in /etc/logrotate.d/ for more examples.


All times are GMT -5. The time now is 07:58 PM.