PDA

View Full Version : Lynx, wget, maybe curl?



champmonkey
11-17-2007, 05:16 PM
Having trouble getting cron to work. Is lynx, wget or curl available on the Hostmonster servers? Trying the path /usr/bin/wget is not working for me.. same for lynx.. I haven't tried curl yet, because I think that most shared hosts turn that off.

shadmego
11-17-2007, 05:36 PM
I tested all three commands by typing <command> --help via ssh and got a list of options for each command. It seems all three are active, though I am not sure which options are available for regular user accounts.

I am also not sure if your absolute path is correct. Try simply typing in the name of the command and see what you get.

~regards, and welcome to the Community!

champmonkey
11-17-2007, 06:14 PM
Many thanks for the reply. Wget works, I was using the server path instead of the URI as it turns out...

For future reference because I found the hostmonster specific solutions to be ambiguous - if you need to set up a cron to request a file the following worked for me

/usr/bin/wget http://www.yourdomain.com/path/to/file.php?php-variable=x

and i recevide the reply from the server


--17:00:01-- http://www.xxx.info/blog/wp-content/path/cron.php?code=018dd
=> `cron.php?code=018dd.1'
Resolving www.xxx.info... 74.220.207.71
Connecting to www.xxx.info|74.220.207.71|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0K 0.00 B/s

17:00:01 (0.00 B/s) - `cron.php?code=018dd.1' saved [0]

which is the result I expect to see from a successful wget request

i wasn't able to get the above working with a regular php cron, and I did read on these forums that when there is a variable passed with the php file it doesn't work, but if all you need to do is make a file request, which is what most web scripts need from cron, IME, wget is a good way to go!

Again, thanks for reply and helpful suggestions!