Koozali.org: home of the SME Server

how to delete log files?

Duan

how to delete log files?
« on: September 19, 2005, 10:09:30 AM »
My SME hard disk is full,can anybody tell me how to delete log files and other useless files?

Black

how to delete log files?
« Reply #1 on: September 19, 2005, 10:36:44 PM »
This works good for me, Just change the DAY from 7 to whatever you want. Just past the second line into the console


#find all files under /dir older than 7 days, and delete


find /dir -type f -mtime +7 | xargs rm -f

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: how to delete log files?
« Reply #2 on: September 19, 2005, 11:49:28 PM »
Quote from: "Duan"
My SME hard disk is full,can anybody tell me how to delete log files and other useless files?


Log files are not useless files.

Moreover just deleting them may not get you back any space at all - if whatever is writing to them is still writing to them, then the file contents will still occupy disk space. You'll only reclaim the space when you stop or restart whatever is filling the files.

You need to identify what has used up all your disk space and remove stuff you really don't need. Most log files on SME server are limited in number and limited in size, so those log files definitely won't be chewing up your space.

Black

how to delete log files?
« Reply #3 on: September 20, 2005, 02:26:58 PM »
Charlie makes a very good point. I noticed Snort was logging a ton of information and that's why my disk was getting full.