Sharon Kimble <boudic...@skimble.plus.com> writes:

> 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 -
> 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 {} +;
>
> and this is the evaulation script line -
> echo 'Back2' - $(du -sh /media/boudiccas/back2/.Trash-1000 | cut -f1)
>
> How can I get it such that it empties the trash bin but does not
> delete the bin itself please?
>
> Thanks
> Sharon.

Add '-mindepth 1' to the conditions, so the that actions actions in the
find command only apply to the directory levels below the starting
level.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/877g4r69xt....@orac.fil

Reply via email to