rm -rf and flags (schg, sunlnk)

2012-11-14 Thread Gary Aitken
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?

thanks,

Gary
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rm -rf and flags (schg, sunlnk)

2012-11-14 Thread Bryan Drewery
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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org