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.
1 Answer
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.
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