By KayBe on
Each month my module needs to reset some values in a database table. I need to reset saldo's in a table I created. I know how to write a function in drupal that does the work but how do I trigger this function each first day of the month at midnight? Do I have to make a cron script? And how does that call my drupal funtion?
Comments
If you've already created
If you've already created your own module, you can do that in hook_cron: http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
Does that help? Then you could check if it's the second day of the month and run your script if it's after midnight.
kwall
www.kwallcompany.com
(Assume you are D7
(Assume you are D7 developer)
Drupal itself has a cron functionality in core. You should implement hook_cron in your module to execute your code in every cron run time. Set cron execution time to "every day" or less; then check if the current time is greater than 1 month.
---
Drupalika | دروپال فارسی
Set cron execution time to
Set cron execution time to "every day"
fordrupal 6 how can have this?
but for execute a function every day is necessary run cron?
with rules is possible and how?
rules performs the function without using cron?