In my GoDaddy control panel I have scheduled it to run this script every day: /web/cgi-bin/php5 "$HOME/html/my_site/cron.php

However I cant figure out how I create tasks that will be run when cron.php is run. I have gone through all the documentation and can't find this anywhere (The D6 video tutorial link seems to be down).

For example how would a go about deleting the contents of a temporary folder?. Do I just add some PHP using the unlink command to the cron.php (in which case drupal is not really involved) or is there some setting page that I havent discovered that allows you to create tasks?

1 Answer 1


Use hook_cron, and implement your functionality in it. This functionality will get executed when the server will ping cron.php.

You just need to set specific time period on which cron will be executed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.