[asterisk-users] Delete voicemail after couple of days

Danny Nicholas danny at debsinc.com
Mon Jul 20 08:30:36 CDT 2009


Tim, this is a partial solution.  The find as written would remove
greetings, unavailable messages, etc.  You would need to add a grep to get
only msg files.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tim Nelson
Sent: Friday, July 17, 2009 5:33 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Delete voicemail after couple of days

----- "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

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list