From owner-freebsd-questions@FreeBSD.ORG Wed Nov 14 20:38:32 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B938A92 for ; Wed, 14 Nov 2012 20:38:32 +0000 (UTC) (envelope-from bryan@shatow.net) Received: from secure.xzibition.com (secure.xzibition.com [173.160.118.92]) by mx1.freebsd.org (Postfix) with ESMTP id 016768FC13 for ; Wed, 14 Nov 2012 20:38:31 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=shatow.net; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=sweb; b=2Bj7gS Q156SHwghRK/2wHWfWAQGrB8j40O3mAl2vhtlSvhbgmBf0hxBK8vmzyUzIyrItcL TfDEwNvEVuu1Af2CBDZbMyiZ8rUns95Q0zcF4w3uazMta8GfoNTLki5rDeeoMNH+ EfBWZSkkdzc+BEJ0Iz/RLNCiy4fN03RJjtvWU= DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=shatow.net; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=sweb; bh=mnmYIiNPZGqh W6Z1XtuYBV0JbLoDHFvaohm5qFjdEG0=; b=kNY14PO1VEYS97QCUlWx1BSvy2be yzpYGTDK6zKWi4mwd2HZQWuH80o8JP143YybFftz5cgK0YsjxvHDI/T9TyKQux0A dIVzPaFA892is1TcAcyIBPkc/jgbPi16Ex58sO+J58hrvy30VrzKShLPyuoKUjG0 gV3PX014XVqvnVk= Received: (qmail 25739 invoked from network); 14 Nov 2012 14:38:29 -0600 Received: from unknown (HELO ?192.168.0.74?) (bryan@shatow.net@74.94.87.209) by sweb.xzibition.com with ESMTPA; 14 Nov 2012 14:38:29 -0600 Message-ID: <50A4015A.3080909@shatow.net> Date: Wed, 14 Nov 2012 14:38:50 -0600 From: Bryan Drewery User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: freebsd@dreamchaser.org Subject: Re: rm -rf and flags (schg, sunlnk) References: <50A40046.1070307@dreamchaser.org> In-Reply-To: <50A40046.1070307@dreamchaser.org> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 20:38:32 -0000 On 11/14/2012 2:34 PM, Gary Aitken wrote: > Assuming one makes a mirror of a file system for backup purposes, > then renames the mirror and makes another one, > then attempts to remove the original using "rm -rf", > the rm will fail if any of the files have the schg or sunlnk bits set. > > Is there an easy way around this problem other than traversing the whole subtree, > finding files with the flags set and unsetting them? > Two options: find /PATH -flags schg -exec chflags noschg {} + or chflags -R noschg /PATH Then rm -rf /PATH > thanks, > > Gary Bryan