IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Using Lynx in cron
I've got a script that's designed to be executed on-demand via browser, or scheduled via cron. Because my host's setup yields completely different environment configurations for web vs shell, I'd have to do a lot of tweaking to get it to auto-detect and work in both.

I discovered they have lynx installed, and it works. So from the command line, I call 'lynx http://host/filename.php' and it executes. I see the output, then I have to quit lynx.

When I schedule this via cron, all I get in the output is:
Status: 404^M

X-Powered-By: PHP/5.1.4^M
Content-type: text/html^M
^M
No input file specified.


Ignoring the line endings, I'm assuming there's something I need to do so that lynx will execute, get the single page of output, and quit. Or is there a better way to do this?



PS: Don't tell me, "Switch to a host that knows how to set things up." I already know that, and I'm working on it.
--

Drew
New Ummm...
RTFM "man lynx"



lynx -dump http://host/filename.php

Give a nice summary of the page


lynx -source http://host/filename.php

Gives the html source.
Expand Edited by folkert Nov. 5, 2009, 04:10:52 PM EST
New I did
Now that I know what that means, it's perfectly clear. It wasn't the first time.

Thanks, now I just need to wait for it to run and see if it worked.
--

Drew
New wget?
From your description, it should fit the bill without the human interface baggage.
New Hey, that's good ... then I put it in *my* cron
Means my desktop machine needs to stay on all the time though. Hmm, good for a short-term fix while I get the server set up though. Thanks for the idea.
--

Drew
New BTW
just an FYI...those ^M are (usually) carriage-return && line-feeds (think DOS/Windows)

Unix just requires carriage-return. (So displays the line-feed as a ^M...iirc)

Run a DOS2UNIX on it and it should get rid of the ^Ms.
New Yeah, not real concerned though
I'm sure they're left over from when someone entered the code on a Windows box. Doesn't really matter to me.
--

Drew
     Using Lynx in cron - (drook) - (6)
         Ummm... - (folkert) - (1)
             I did - (drook)
         wget? - (scoenye) - (1)
             Hey, that's good ... then I put it in *my* cron - (drook)
         BTW - (Mycroft_Holmes_Iv) - (1)
             Yeah, not real concerned though - (drook)

So I pulled into a Shell station. They said I'd blown a seal. I said, "Fix the damn thing and leave my private life out of it, OK, pal??"
59 ms