[Asterisk-Dev] Question on using system(find args -exec rm {} \; )

Rusty Dekema rdekema at gmail.com
Sun Jan 1 12:29:38 MST 2006


This is kind of obvious and is probably not the cause of your problem, but
it has tripped me up from time to time when trying to code things in the
Asterisk dialplan. Are you sure that the two variables you reference
(${PathRecordingTemp}
and ${CUSTNUM}) have been defined and hold the correct values before you try
to reference them in your system call?

Just a thought; I don't see anything wrong other than that.

-Rusty

On 12/30/05, bday at prosodiemail.com <bday at prosodiemail.com> wrote:
>
> All,
>
> I am using Asterisk 1.0.7 and having a problem using system(find ... -exec
> rm .. ) application as follows.
>
>  I'm trying to perform a system() application in my dialplan to remove all
> files that are older than 2 days.  I get a n+101 error using the following
> syntax (yes, there are files in this directory older than 2 days) and was
> wondering if you see any obvious mistakes in my syntax?
>
> The command works ok on the Command Line, but not inside my dialplan.
> I've researched a number of resources and the only thing I can find is in
> the GNU man pages for FIND where it mentions that I might need to escape the
> args for the -exec, but I've tried all the escape combinations with no
> success!   The FIND works ok without the -exec so I have focused my
> troubleshooting to the -exec portion.  Any suggestions?
>
> ;this finds  & removes all files in specified directory that are older
> than 2 days
>
> exten => s,2,system(find ${PathRecordingTemp}/${CUSTNUM} -mtime +2
> -maxdepth 1  -exec rm {} \;)
>
> Thanks
>
> Bill DAY- SW Engineer
> ---------------------------------------------
> PROSODIE Interactive
> Phone: 954-671-6532
> Fax: 954-343-5684
> Corporate: 1-866-PROSODIE
> bday at prosodiemail.com
> ---------------------------------------------
> www.prosodieinteractive.com
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20060101/fc561197/attachment.htm


More information about the asterisk-dev mailing list