Can't save data in hook_node_update()
hook_node_presave($node)


  Act on a node being inserted or updated.
  
  This hook is invoked from node_save() before the node is saved to the
  database.
  Parameters
  
  $node: The node that is being inserted or updated.


function hook_node_presave($node) {

if ($node-&gt;type == 'your_node_type') {
// you can write your desired code here


}

}