Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

2 Answers

up vote 3 down vote accepted

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

share|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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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