dsaba Posted April 4, 2007 Share Posted April 4, 2007 I'm going to try to explain what i want to do, to the best of my ability. So read carefully. I want to setup a cronjob to run a certain script, nothing different here. Normally you have to specify a url to the script and the script name, in order for the cron to run it. From my understanding the "cron" which does the "job" is a machine a server, with an ip..etc... This machine can run certain commands to execute and do different things. I want to make my script url dynamic by saying "http://urltoscript.php?time=CRONCOMMANDFORTIME" I know that this machine called the "cron" can execute a command to call a timestamp or read the current time..whatever I simply want to have it call the timestamp and echo it as part of the script url that is supposed to execute Is this possible? and if so could you show me a basic code to do this in "cron code" my second question is if this "cron" is indeed a machine or a server, does it accept cookies and sessions like a normal user surfing the web does? -thank you Quote Link to comment Share on other sites More sharing options...
btherl Posted April 4, 2007 Share Posted April 4, 2007 cron does not accept cookies and sessions. It just runs programs at a specific time, that's it. It's very simple and dumb. The simple solution is to have cron call a wrapper php script, and have that php script call the real script (the one on your url) with whatever arguments you want to pass along to it. Then you have the full flexibility of php available to you. Quote Link to comment Share on other sites More sharing options...
dsaba Posted April 4, 2007 Author Share Posted April 4, 2007 i was thinking of that btherl BUT how exactly would this php script wrapper work? how would i make that php script load another php script? would I use file_getcontents ?? what code would i put in that script wrapper? Quote Link to comment Share on other sites More sharing options...
dsaba Posted April 4, 2007 Author Share Posted April 4, 2007 bump Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.