[development] How to clear database after a regular interval

Arancaytar Ilyaran arancaytar.ilyaran at gmail.com
Sat Mar 7 18:55:02 UTC 2009


Depends on what exactly you want to clear. If you just need to empty the
user/node tables or reset the site theme, it's fairly straight-forward - just
put a few "DELETE" statements in the hook_cron implementation.

Re-installing the entire site would be tricky to do via a module inside the site
itself ("cutting off the branch you're sitting on"). In that case, you would be
better served by a batch script started by a separate cron-job outside the
Drupal site.

Robrecht Jacques wrote:
> Write a module that implements hook_cron().
> 
> 2009/3/7 sivaji j.g <sivaji2009 at gmail.com <mailto:sivaji2009 at gmail.com>>
> 
>     Hello geeks,
> 
>     Most of the drupal modules has test site programmed to clear
>     database after a regular interval, i would like to know how it
>     works. I want to do the same for drupal quiz module demo site, The
>     demo site has been hosted at bluehost which has cpanel where i have
>     options to write my own cron and run it, but i have no idea on how
>     to use it for this purpose.  Any suggestions and criticisms
>     regarding this will be appreciated.
> 
>     -- 
>     Thanks a lot
>     -----------------------------------------
>     http://ubuntuslave.blogspot.com/
> 
> 


-- 
eternity lies ahead of us, and behind.
have you drunk your fill?
         * * *
PGP:   http://ermarian.net/downloads/0x27CA5C74
XMPP:  arancaytar.ilyaran at gmail.com
AOL:   282026638 @icq / RealArancaytar @aim
URL:   http://ermarian.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.drupal.org/pipermail/development/attachments/20090307/47805143/attachment.pgp 


More information about the development mailing list