<div class="gmail_quote">On Sat, Mar 7, 2009 at 1:55 PM, Arancaytar Ilyaran <span dir="ltr"><<a href="mailto:arancaytar.ilyaran@gmail.com">arancaytar.ilyaran@gmail.com</a>></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's fairly straight-forward - just<br>
put a few "DELETE" 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 ("cutting off the branch you're sitting on"). 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>
> Write a module that implements hook_cron().<br>
><br>
</div>> 2009/3/7 sivaji j.g <<a href="mailto:sivaji2009@gmail.com">sivaji2009@gmail.com</a> <mailto:<a href="mailto:sivaji2009@gmail.com">sivaji2009@gmail.com</a>>><br>
<div><div></div><div class="h5">><br>
> Hello geeks,<br>
><br>
> Most of the drupal modules has test site programmed to clear<br>
> database after a regular interval, i would like to know how it<br>
> works. I want to do the same for drupal quiz module demo site, The<br>
> demo site has been hosted at bluehost which has cpanel where i have<br>
> options to write my own cron and run it, but i have no idea on how<br>
> to use it for this purpose. Any suggestions and criticisms<br>
> regarding this will be appreciated.<br>
><br>
> --<br>
> Thanks a lot<br>
> -----------------------------------------<br>
> <a href="http://ubuntuslave.blogspot.com/" target="_blank">http://ubuntuslave.blogspot.com/</a><br>
><br>
><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>