Get Hazel to delete old Console Logs?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Get Hazel to delete old Console Logs? Sun Apr 01, 2012 8:23 am • by morkafur
Is it possible to have Hazel delete old Console logs?

I currently do this using Onyx, but it would be great if I could automate the log cleanup in Hazel.

Since these files are maintained by the Mac OS, I'm not sure how best to approach this.

Thanks in advance.

- m
morkafur
 
Posts: 15
Joined: Mon Mar 19, 2012 12:54 pm

Re: Get Hazel to delete old Console Logs? Sun Apr 01, 2012 3:18 pm • by a_freyer
I'd monitor the log folder and delete files that are older than a few weeks. Hazel can absolutely do this.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Get Hazel to delete old Console Logs? Sun Apr 01, 2012 5:57 pm • by morkafur
a_freyer wrote:I'd monitor the log folder and delete files that are older than a few weeks. Hazel can absolutely do this.


Are you saying /private/var/log folder???

I have a file in there, kernel.log.1 that's over 2 GB.

Is this safe to delete?

I have no idea.

What about the other files in this folder?

Anything with ".log" safe to delete?

Your reply didn't have quite enough information.

Thanks for clarification.

- m
morkafur
 
Posts: 15
Joined: Mon Mar 19, 2012 12:54 pm

Re: Get Hazel to delete old Console Logs? Sun Apr 01, 2012 6:38 pm • by a_freyer
Well it depends on what you're trying to delete. Generally, logs are perfectly fine to delete because they're just that: a log of what has already happened.

However, 99% of logs are going to be less than a few Kb. There isn't any reason to worry about these files accumulating.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Get Hazel to delete old Console Logs? Mon Apr 02, 2012 5:44 am • by morkafur
Thanks. I was just a bit worried since this folder was "/private/....". I didn't want to, say, remove a log file that was open and cached by the Mac OS, just to have the OS crash when the log suddenly wasn't there anymore.
- m
morkafur
 
Posts: 15
Joined: Mon Mar 19, 2012 12:54 pm

Re: Get Hazel to delete old Console Logs? Mon Apr 02, 2012 7:26 am • by morkafur
The problem I ran into trying to delete the log files in /var/private/log is that you must authenticate before deleting them.

Therefore, since I don't know how to have Hazel enter my password, it fails to remove these files.

Is there a way to authenticate in Hazel I haven't found so it can delete the log files in this folder?

Thanks in advance.

- m
morkafur
 
Posts: 15
Joined: Mon Mar 19, 2012 12:54 pm

Re: Get Hazel to delete old Console Logs? Mon Apr 02, 2012 12:32 pm • by Mr_Noodle
I believe the system should be doing this for you. Is there a reason why you need Hazel for this?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Get Hazel to delete old Console Logs? Mon Apr 02, 2012 1:24 pm • by morkafur
With a log file over 2 GB, it doesn't seem the system is doing anything to keep this file size in check.

Also, why would people use utilities like Onyx for clearing the log files?

Maybe I'm confused about this?
morkafur
 
Posts: 15
Joined: Mon Mar 19, 2012 12:54 pm

Re: Get Hazel to delete old Console Logs? Mon Apr 02, 2012 2:45 pm • by Mr_Noodle
Check out this article:

http://wiki.springsurprise.com/2011/10/ ... -mac-os-x/

It requires some commandline/UNIX skills but you can edit the /etc/newsyslog.conf file to fix this. It seems the system.log file does not have a max size like the other log files (the files are rotated based on time) but you can edit it to have max size as well. Do "man newsyslog.conf" to get more info about the file format.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support