[asterisk-users] Delete voicemail after couple of days

Tim Nelson tnelson at rockbochs.com
Fri Jul 17 17:32:56 CDT 2009


----- "Steve Edwards" <asterisk.org at sedwards.com> wrote:
> On Fri, 17 Jul 2009, Miguel Molina wrote:
> 
> >> I think the OP caught the humor -- note the "smiley." I'm sorry it
> 
> >> didn't translate to your language.
> 
> > Oops, well I'm not a native english speaker so it's really hard to
> catch 
> > some humor of a word that I don't know or I get as misspelled.
> Thanks 
> > for the definition, now I can laugh with you guys.
> >
> > Sorry for all the fuzz around this.
> >
> > PD: Es como si yo te contara un chiste en español!
> 
> Si, pero el Ingles es mejor que mi espanol!
> 
> (Google translate is my friend.)
> -- 

All the politics, list etiquette, and general bitching aside, here is how I would do what the OP wants.

Write up a small shell script that uses 'find /var/spool/asterisk/voicemail/ -mtime +2' for a list of files older than two days assuming you want ALL files deleted older than two days. You could always grep that output if you only wanted to delete voicemail that is not still in the INBOX or elsewhere. Anyways, then use -exec to rm the files. If the goal was to remove all files, it might look something like this:

#!/bin/bash
find /var/spool/asterisk/voicemail/ -mtime +2 -exec rm  {}\;

Run that from cron once a day/hour/whatever and you're set.

<rant>
It still amazes me how often posters are unable to get a simple answer to a question and instead are inundated with 'you top posted', 'you didn't ask the question right', 'your spelling was wrong', etc...  I mean, is this list just a really big bridge with a bunch of trolls(no pun intended) waiting to pounce on people just wanting to get to the other side where "Asterisk Enlightenment" awaits?

And of course because I've diverted from the norm and possibly hurt someone's ego, I expect a full backlash or smarmy remarks etc. Thank you in advance.
</rant>

--Tim



More information about the asterisk-users mailing list