0

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.

2
  • 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 '13 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 '13 at 11:32
2

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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