[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Auto-emptying of trash.



On Sun, Jun 8, 2014 at 4:03 AM, Sharon Kimble
<boudiccas@skimble.plus.com> wrote:
>
> Revisiting a question that I asked in March last year about how to
> auto-empty a trash bin.
>
> This has worked very well until today, when on one of my drives it
> also deleted the trash bin as well, so my follow-on script to give
> me the size of my trash bin failed as there wasn’t a trash bin to
> evaluate!
>
> Here is the script lines -
> --8<---------------cut here---------------start------------->8---
> find /media/boudiccas/back2/.Trash-1000 -type f -mtime +"$days" -delete;
> find /media/boudiccas/back2/.Trash-1000 -depth -type d -exec rmdir --ignore-fail-on-non-empty {} +;
> --8<---------------cut here---------------end--------------->8---

Use "-mindepth 1":

[localhost:/home/th/Public]$ find .
.
[localhost:/home/th/Public]$ find . -mindepth 1
[localhost:/home/th/Public]$


Reply to: