Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mork

macrumors 6502a
Original poster
Jan 9, 2009
539
34
I have some very large ".log" files in the /private/var/log folder.

kernel.log.1, for example, is over 2 GB.

I'd like to set up a Hazel rule to delete any file in that folder that ends with ".log".

The problem is I want to make sure none of these files are cached by the Mac OS and "expected" to be there for writing.

Since I found these .log files in a directory that starts with "private", I wanted to make sure first.

All the other log directories are small by comparison.

So, is it OK to remove files with ".log" in the file name in /private/var/log?

Thanks in advance.

- m
 
Yes, you can delete the logs.

But the best way to do it would be:
  • Open Terminal
  • Type "sudo periodic daily weekly monthly"
  • Type "sudo newsyslog -F"
  • You can then safely delete any logs ending in .1 (2,3,4,ect.), .bz2, .gz or .out (as they are no longer in use)

As for you personal log folder in ~/Library/logs you can just trash everything without worrying.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.