1

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.

  • 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 – daisy Oct 6 '11 at 13:34
  • 1
    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 – daisy 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
1

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

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.