what is the best way to find out if a custom hook_cron which runs automatically , has been run? I did use drupal_set_message and watchdog but they weren't suitable for automatic crons.

  • 3
    What wasn't suitable about using watchdog()? That's how Drupal core communicates that a cron has been run; whether it was 'automatic' or not is completely incidental, the code will fire either way
    – Clive
    Apr 10, 2013 at 10:55
  • the database loging module is disable and the table has many records. is there a way to clear it without refering to mysql?
    – nooshinha
    Apr 10, 2013 at 11:32

1 Answer 1


When Cron runs, it leaves a message in the next table: Reports -> Recent log messages.

If you want to know if a specefic hook has been run, you could try an experiment. For example, you could create a variable called module_variable with value 0 in your database table and increment this value each time the hook is run.

  • tanx a lot, I'm going to use variables. nice solution
    – nooshinha
    Apr 10, 2013 at 11:33

Your Answer

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

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