hi Carlos,
are you using these contexts for storing data, or only as names? If they are 
used only as names, you can take advantage of the 'alias' action for creating 
many names for a single context, and the call 'delete' for this context once a 
day that drops all names. This scheme as one advantage -- it only drops 
arrancado_* contexts, while retaining other context data.

However, there are several other possibilities -- you could use the Calendar 
rule for triggering SingleWithScript rule which writes all context names to 
disc, and then use 'spawn' action from the same rule to read in context names 
as synthetic events and delete the contexts:

tyoe=Calendar
time=0 0 * * *
desc=trigger the deletion of arrancado contexts
action=event GetContextNames

type=SingleWithScript
ptype=SubStr
pattern=GetContextNames
script=cat >/tmp/contexts
desc=Save Contexts
action=spawn cat /tmp/contexts

type=Single
ptype=RegExp
pattern=^(arrancado_.*)
desc=delete the $1 context
action=delete $1

Another way for dropping all contexts is the following rule:

tyoe=Calendar
time=0 0 * * *
desc=drop all contexts
action=eval %o ( %main::context_list = () )

Is there any specific reason you would like to delete all contexts at the same 
time? If not and you would rather like to have a fixed lifetime for every 
context for memory management purposes, I would recommend to simply set a 
lifetime of 24 hours for each context at the moment of creation.

Hope this helps,
risto

> Hello,
> 
> I have a rule in sec that creates context with a part of
> the pattern in the
> name of the context. I use this expression:
> 
> action= create arrancado_$1
> 
> I want to delete all de contexts of this rule once a day. I
> need something
> like
> 
> Action= delete * (or arrancado_*)
> 
> If I do a SIGHUP or I restart de process it will work, but
> I can't  do that
> 
> Thank you
> 
> Best Regards
> 
> 
> 
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit.  See the prize list and enter to
> win: 
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Simple-evcorr-users mailing list
> Simple-evcorr-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
> 


      

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to