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 Link to comment https://forums.phpfreaks.com/topic/45511-cron-jobs-setting-the-script-name-to-be-dynamic-read-this-one-carefully/ 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. Link to comment https://forums.phpfreaks.com/topic/45511-cron-jobs-setting-the-script-name-to-be-dynamic-read-this-one-carefully/#findComment-220984 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? Link to comment https://forums.phpfreaks.com/topic/45511-cron-jobs-setting-the-script-name-to-be-dynamic-read-this-one-carefully/#findComment-220988 Share on other sites More sharing options...
dsaba Posted April 4, 2007 Author Share Posted April 4, 2007 bump Link to comment https://forums.phpfreaks.com/topic/45511-cron-jobs-setting-the-script-name-to-be-dynamic-read-this-one-carefully/#findComment-221389 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.