...

View Full Version : Cron Job Question - No Code



fl00d
01-20-2008, 03:50 AM
Hi,

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?

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


<?
DEFINE('IS_CRON','1');
?>

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum