From owner-freebsd-questions@FreeBSD.ORG Thu Jan 13 22:24:32 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF7101065673 for ; Thu, 13 Jan 2011 22:24:32 +0000 (UTC) (envelope-from xaero@xaerolimit.net) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 571288FC0C for ; Thu, 13 Jan 2011 22:24:31 +0000 (UTC) Received: by eyf6 with SMTP id 6so1162658eyf.13 for ; Thu, 13 Jan 2011 14:24:31 -0800 (PST) Received: by 10.213.105.205 with SMTP id u13mr1040704ebo.25.1294957470930; Thu, 13 Jan 2011 14:24:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.8.142 with HTTP; Thu, 13 Jan 2011 14:24:10 -0800 (PST) In-Reply-To: References: <000301cbb307$49788810$dc699830$@com> From: Chris Brennan Date: Thu, 13 Jan 2011 17:24:10 -0500 Message-ID: To: Swe Gill Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Pegasus Mc Cleaft , freebsd-questions@freebsd.org Subject: Re: httpd-modsec2_debug.log: Operation not permitted X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 22:24:32 -0000 On Thu, Jan 13, 2011 at 5:08 PM, Swe Gill wrote: > That is the problem. One file sizes upto 50GB and other 3 GB... > > 52872944 -rw-rw---- 1 root wheel 50G Jan 13 22:51 > httpd-modsec2_audit.log > 3320928 -rw-rw---- 1 root wheel 3.2G Jan 13 22:51 > httpd-modsec2_debug.log > > I am just standing nowhere to remove the files.... > > have tried by setting flags, changing modes.... all as a root but no luck > yet... > > Any help? > > /S > > Sweet Jebus! Ever hear of logrotate[1]? That would at least have solved this problem in advance. My previous idea still stands. I believe rm (-f) still requires *SOME* free space on a device to delete something. That being said, do you have more then 50G free elsewhere on the system? Say /home (/usr/home)? If you do, mv the file from /var/log to /usr/home. This would effectively delete it from /var/log and free up it's space. Once it's moved to a different location, you should have no problems doing with it as you wish, compress and archive it or just arbitrarily delete it from the new device if no backup is needed. [1] I use a default setup for logrotate, it then archives each file in /var/log, I then just archive /var/log/*.bz2 based on date and delete the old bz2 archives from /var/log. This keeps /var/log pretty trimmed and the only time it runs out of space is when something goes wild and eats up all of it's space before logrotate can clean things up.