Cleaning out /tmp on startup [cleanfs]

Nathan Coulson conathan at conet.dyndns.org
Wed Mar 24 17:58:02 PST 2004


> On Seg, 22 Mar 2004 15:13:13 -0700, Nathan Coulson wrote:
>> cd /tmp; find . -xdev ! -name . ! \( -name lost+found -uid 0 \) -depth
>> -exec rm -rf {} \; [With the help of Zack]
>
> "! -name ." can be changed to "-mindepth 1". Also, I suggest use "&&"
> after the cd command instead of semicolon. What happens if, for some
> reason, the cd command fails? ;)
>
> Also, "! -name lost+found" was used to avoid removing lost+found, but
> the files inside it (lost inode contents, AFAIK) are still removed.
> "-path" can be used instead to avoid this.
>
> An alternative command (not tested) could be:
>
> find /tmp -xdev -mindepth 1 ! -path '/tmp/lost+found*' -depth \
> -exec rm -rf {} \;
>
> --
> Anderson Lizardo

I guess that means that 2.0.2 is going to be released... ):



More information about the blfs-dev mailing list