Run hook_nodeapi("pre save") but only on inserts, not on updates
You can know if it an update or insert by looking the $node-&gt;nid value. If you've a number it's an update otherwise an insert. 

You can see an example directly on the documentation.