How can I know that node is created or updated? I had configured Drupal 7. I'm going to run cron when a node is saved/updated/deleted. How  I know that node is changed?

Thanks.
Modules that need to execute code during cron tasks, and for nodes that have been created/updated/delete already implement code to do that. If you need something similar for your own module, you could use the following code.

function mymodule_node_insert($node) {
  $queue = DrupalQueue::get('mymodule_cron_queue');
  $queue-&gt;createQueue();
  $queue-&gt;createItem($node);
}

function mymodule_cron_queue_info() {
  $queues['mymodule_cron_queue'] = array(
    'worker callback' =&gt; 'mymodule_cron_worker', 
    'time' =&gt; 10,
  );

  return $queues;
}

function mymodule_cron_worker($node) {
  // Code that uses $node.
}


With this code, mymodule_cron_worker() is called during cron tasks for every node that has been created; if you need to execute code during cron tasks for updated nodes, or deleted nodes, then you need to implement hook_node_update(), or hook_node_delete(). The code I shown for hook_node_insert() is the same code you would use for the other node hooks.

References


Queue operations
Example: Cron