Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Prevent SkyMACMate software from filling console.log' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Prevent SkyMACMate software from filling console.log
Authored by: fracai on Jun 07, '07 09:37:33AM
"Clearing" the log file from Console.app doesn't affect the file on disk. It just clears the view in the Console.
A cleaner solution would monitor the log directory and truncate or delete files that grow too big. This could be set up with launchd and find.
something like the following will find all files in the standard log directory that are 10 MB or greater in size and delete them:
find /var/log -size +10M -type f -name "*.log" -delete

really you want to just truncate with "> log". deleting the file means nothing new will show up in the log. truncating with "> log" or "cat /dev/null > log" should cut the size of the file without breaking logging. I think.

I'm also not sure if MacOS X find includes support for the "-size +" format. the whole truncating part should be pretty easy using xargs, but I can't test anything right now.

---
i am jack's amusing sig file

[ Reply to This | # ]