[sylpheed:35443] [SOLVED] Re: Re: Expire trash?
Dennis Carr
dennisthetiger at chez-vrolet.net
Wed Aug 8 07:12:21 JST 2012
On Wed, 13 Jun 2012 12:14:37 -0700
Dennis Carr <dennisthetiger at chez-vrolet.net> wrote:
> Then I'm going to play with a few things in bash for a bit, involving
> for and find, for a way to do this in *nix. I'll come back with a
> good recipe. I think it'd be something like 'find ~/Mail/trash
> -ctime +nn -erase' where nn is expiry days.
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.
Caveat: this works only in Linux and relies heavily on bash syntax.
I'm not familiar with any other shell....7
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.
-Dennis
More information about the Sylpheed
mailing list