View Full Version : Cron Job Question - No Code

01-20-2008, 04:50 AM

I have a question about Cron Jobs that I haven't been able to find the answer too anywhere. Is there anyway to distinguish a cron job and user from accessing my script? Like is there a way to identify if my server is reading the script or if a user is and depending on which perform a separate action? I thought of using IP's, but I don't know if a cron job has one... if that makes any sense.

BAsically I want the script to redirect users elsewhere, but allow the cron job to run the script. I know I could just place the script where a user can't access it, but I want to see if my distinguishing method is possible.

Any idea's?

01-20-2008, 12:12 PM
if your cron job points to a script you can define something in that script, I normally...


in any scripts if they are being run from cron, you could just as easily define a variable in a shell script, else check for $_SERVER vars which will not exist if its a cron/cgi job