<div class="gmail_quote">On Sat, Mar 7, 2009 at 1:55 PM, Arancaytar Ilyaran <span dir="ltr">&lt;<a href="mailto:arancaytar.ilyaran@gmail.com">arancaytar.ilyaran@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Depends on what exactly you want to clear. If you just need to empty the<br>
user/node tables or reset the site theme, it&#39;s fairly straight-forward - just<br>
put a few &quot;DELETE&quot; statements in the hook_cron implementation.<br>
</blockquote><div><br>If you take this approach, and you use MySQL like most Drupal sites do, then use TRUNCATE on the tables. It is much faster and less resource intensive. Would not matter if you only have a small amount of data, but will matter for larger amounts.<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Re-installing the entire site would be tricky to do via a module inside the site<br>
itself (&quot;cutting off the branch you&#39;re sitting on&quot;). In that case, you would be<br>
better served by a batch script started by a separate cron-job outside the<br>
Drupal site.<br>
<div class="im"><br>
Robrecht Jacques wrote:<br>
&gt; Write a module that implements hook_cron().<br>
&gt;<br>
</div>&gt; 2009/3/7 sivaji j.g &lt;<a href="mailto:sivaji2009@gmail.com">sivaji2009@gmail.com</a> &lt;mailto:<a href="mailto:sivaji2009@gmail.com">sivaji2009@gmail.com</a>&gt;&gt;<br>
<div><div></div><div class="h5">&gt;<br>
&gt;     Hello geeks,<br>
&gt;<br>
&gt;     Most of the drupal modules has test site programmed to clear<br>
&gt;     database after a regular interval, i would like to know how it<br>
&gt;     works. I want to do the same for drupal quiz module demo site, The<br>
&gt;     demo site has been hosted at bluehost which has cpanel where i have<br>
&gt;     options to write my own cron and run it, but i have no idea on how<br>
&gt;     to use it for this purpose.  Any suggestions and criticisms<br>
&gt;     regarding this will be appreciated.<br>
&gt;<br>
&gt;     --<br>
&gt;     Thanks a lot<br>
&gt;     -----------------------------------------<br>
&gt;     <a href="http://ubuntuslave.blogspot.com/" target="_blank">http://ubuntuslave.blogspot.com/</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
</div></div><font color="#888888">--<br>
eternity lies ahead of us, and behind.<br>
have you drunk your fill?<br>
         * * *<br>
PGP:   <a href="http://ermarian.net/downloads/0x27CA5C74" target="_blank">http://ermarian.net/downloads/0x27CA5C74</a><br>
XMPP:  <a href="mailto:arancaytar.ilyaran@gmail.com">arancaytar.ilyaran@gmail.com</a><br>
AOL:   282026638 @icq / RealArancaytar @aim<br>
URL:   <a href="http://ermarian.net" target="_blank">http://ermarian.net</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a>, Inc.<br><a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.<br>
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra<br>Simplicity is the ultimate sophistication. --   Leonardo da Vinci<br>