Is Lynx or wget more efficient?

I’m trying to run a php script via CRON and have only had luck getting it to work using the lynx command in the shell. While it works in the shell, I do have to press q afterwards to exit the lynx program. I assume when it’s run via cron this is somehow not needed?

Anyways, I’ve been reading that wget could be used for this as well (to run a php script via cron). If so, which would be the most efficient/least CPU? (It’s just a very basic script, but needs to be run regularly).

Thanks.

I’d suspect wget would be more suitable. wget is intended for command line and script usage.

Wholly

Ok thanks…another question if you have time…
Is there a way (I’m sure there is, I just don’t know wget at all) to dump/not create a file when wget is run? I just need it to run the script, not download it’s contents or anything. I think the default is for wget to save the output somewhere - which would pile up files quickly. Is this doable?

I think even better would be to get the darn recommended method working that’s in the wiki:

/home/myusername/myusername.com/cgi-bin/php.cgi /home/myuser/myscript.php

…but when run in ssh, it says “No input file specified”. I have a custom version of php 4 running, and working correctly - so I don’t think it’s that. It must be something in the directory path I’m missing or a command?

Again sorry for all of the questions, I just want this to be efficient since it’ll run every 10 min or so and not tie up the CPU. Thanks again for the help.

You can add “–delete-after” to wget to throw away the downloaded file afterwards, but I agreed that running the php straight is surely a better idea than going through the web server.

I’ve not done it though, I’m not a php junkie. Someone here like rlparker will swoop in and answer your question properly.

Wholly

Ok thanks, hoping for rlparker! to shed some light on this hopefully then :slight_smile:

I also got wget to not save the file by using:
*/15 * * * * wget -O /dev/null http://www.site.com/script.php 2> /dev/null

Probably doing about the same thing as what you mentioned, “”–delete-after" I assume. Since mine works I probably won’t change it unless the way I posted above is not as efficient or is bad? Thanks though for the help.

rlparker - if you’re there and have a few seconds to spare, do you know why the php problem I mentioned won’t work (the direct processing of php which gives me the “no input file” error)? Thanks again everyone.

Hey…

/home/myusername/myusername.com/cgi-bin/php.cgi /home/myuser/myscript.php

Is this supposed to be

/home/myusername/myusername.com/cgi-bin/php.cgi < /home/myuser/myscript.php

Wholly