[sylpheed:35444] Re: [SOLVED] Re: Re: Expire trash?

Craig freecycle01 at pisquared.net
Wed Aug 8 08:47:32 JST 2012


On Tue, 7 Aug 2012 15:12:21 -0700 Dennis Carr
<dennisthetiger at chez-vrolet.net> wrote:

> And solved it.  In a cron job, do this:
> 
> x x * * * rm `find /path/to/Trash-folder -ctime +31 -type f`
> 2> /dev/null
> 
> ...where x in the cron column is minutes and hours respectively.  Pick
> your time. =)  Also, I use 31 for anything over 30 days; adjust
> accordingly to your tastes.

Nice work!


> Caveat: this works only in Linux and relies heavily on bash syntax.
> I'm not familiar with any other shell....7

If you are running another shell, you can put the following in a shell
script:

#!/bin/sh
rm `find /path/to/Trash-folder -ctime +31 -type f` 2> /dev/null

and call the shell script with cron.


> The 2> /dev/null is because of something else- if
> there's nothing older than ctime +31, there's nothing to rm and you
> will get an error in your email otherwise.

You can also use rm -f, which won't complain if there is nothing to
remove.


Craig


More information about the Sylpheed mailing list