Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Cron Job Question - No Code
01-20-2008, 03:50 AM #1
- Join Date
- Mar 2007
- Thanked 7 Times in 7 Posts
Cron Job Question - No Code
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.
01-20-2008, 11:12 AM #2
- Join Date
- May 2002
- Perth Australia
- Thanked 101 Times in 99 Posts
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 jobPHP Code:
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)