3

tldp.org quotes /var as:

Files in /var/log can often grow indefinitely, and may require cleaning at regular intervals.

So without cleaning, using a system for a long enough period will fill up all of /var.

Do some distros rotate logs automatically or is in generally accepted it's the user's role. With so many new people getting into *nix, this be better know, and how should this be handled?

John Militer
  • 773
  • 4
  • 14
  • 29
invert
  • 1,743
  • 1
  • 19
  • 24
  • To add, I asked this while setting up a CentOS VM with a small disk, with intent on putting /var in it's own partition. – invert Feb 21 '12 at 14:53

2 Answers2

4

There is logrotate which cleans /var/log regularly by using cron jobs.

It is normally installed automatically (at least in Debian and its derivatives like Ubuntu).

vilpan
  • 127
  • 4
jofel
  • 26,513
  • 6
  • 65
  • 92
  • Good to know this is done by default, very sane. I found /etc/cron.daily/logrotate which led to /etc/logrotate.conf, it keeps 4 weeks of logs. Thanks! – invert Feb 21 '12 at 14:52
0

I would suggest you to put a cron job for rotating the log. depending on your logs you can have cronjob which moves the /var/log to /var/log.<timestamp>once in 30 days or 2 months or If you want to delete it. remove it using a cron job. for putting cron job see this

harish.venkat
  • 7,313
  • 2
  • 25
  • 30