Is there any easy way to determine who is accessing a script?

For example, if I run a php script as a cron job, can I determine that the script is indeed being loaded as a cron job and not directly from someone's browser?

I know its probably easier to move the php file outside the web root, but for arguments sake... could I use remote_addr?