If doing this, I&#39;d suggest checking for a global var to see if the script should terminate itself.  Otherwise, you&#39;ll have to bring down the whole freeswitch to stop this script.<br><br><div class="gmail_quote">On Thu, Dec 3, 2009 at 7:28 AM, Seven Du <span dir="ltr">&lt;<a href="mailto:dujinfang@gmail.com">dujinfang@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Not sure about js, but in lua, you can use luarun to run a<br>
long-running script like<br>
<br>
<br>
loop<br>
do sth.<br>
sleep 5min<br>
end<br>
<br>
and also it can be set to start with freeswitch in lua.conf.xml<br>
<br>
I guess you can also use jsrun to run js.<br>
<br>
And, if you run every 5 min, why not use crontab?<br>
<br>
fs_cli -x &quot;jsrun xx.js&quot;<br>
<br>
<br>
2009/12/3 Oscav &lt;<a href="mailto:oscav@hotmail.fr">oscav@hotmail.fr</a>&gt;:<br>
<div><div></div><div class="h5">&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; Someone knows how to run periodically a JS script ?? The purpose is to write<br>
&gt; to a db some global informations (Global Variables) about FS like every 5<br>
&gt; minutes.<br>
&gt;<br>
&gt; Thanks.<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://old.nabble.com/How-to-run-a-JS-script-periodically-tp26625147p26625147.html" target="_blank">http://old.nabble.com/How-to-run-a-JS-script-periodically-tp26625147p26625147.html</a><br>

&gt; Sent from the Freeswitch-users mailing list archive at Nabble.com.<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; FreeSWITCH-users mailing list<br>
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-Rupa<br>