Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to remove unnecessary logs automatically , like Xorg.log.0 , and other packed *.gz files , i really don't need that on a laptop system.

However , i checked man logrotate , but only an entry called shred , but irrelevant.

share|improve this question
On a laptop do you really need to keep any logs? - You might consider switching off syslogd (to reduce writes) and deleting files from /tmp and /var/log at boot/shutdown. You might even consider putting these on a ramdisk or tmpfs – symcbean Oct 6 '11 at 13:33
@symcbean: i can't use tmpfs as hibernation is often used , currently i'm redirecting kernel messages to /dev/tty12 , which is limited memory , without disk writing , so syslogd can't be turned off – warl0ck Oct 6 '11 at 13:34
Sorry @symcbean, but the idea to disable logging seems just stupid. The logs are there to help you. Getting rid of that facility for the mere purpose of increasing battery life by maybe a few percent sounds fanatic. If your logger does too much writes and does not ever let the drive spin down, then something is wrong with your configuration or system - and that is why you need logs. – rozcietrzewiacz Oct 6 '11 at 13:55
@rozcietrzewiacz , what about to reduce disk writing – warl0ck Oct 6 '11 at 13:57
@warl0ck [see edited comment above] It looks like swiping the dirt under the carpet instead of taking your shoes off. – rozcietrzewiacz Oct 6 '11 at 13:58
up vote 1 down vote accepted

Removing old logs is the main job of logrotate. The number of old log versions kept on your disk is set by the rotate config option.

Also, take a look at the configuration files (/etc/logrotate.conf and /etc/logrotate.d/*) as well as man logrotate to see various ways how the rotation can be triggered (like monthly or by size limit).

share|improve this answer

Your Answer


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.