How can I tell that my hook_nodeapi function is being called by cron and not a user?
How is cron being executed?  If done via crontab like

0 1 * * *   /usr/bin/wget -O - -q -t 1 http://my.site.com/cron.php


then I suspect that

function hook_whatever () {
  global $user;

  if (strpos(request_uri(), "/cron.php") === 0 &amp;&amp; $user-&gt;uid == 0) {
    // from crontab
  } else {
    // from somewhere else
  }
}


would work.

Manually running from one of the admin pages may be trickier, but taking out the $user-&gt;uid check may suffice in that case.