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?

  • 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

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).

| improve this answer | |
  • 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

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.