Using lynx for cron

software development


I set up a cron job to execute a php file using lynx.
0 0 * * * lynx -dump http://path/to/file.php

It works from the shell but when I run my cron I get an error saying:
“The requested URL /file.php was not found on this server.”

First time working with this so any help is appreciated.



Is that the actual line you’re using? With the http protocol, the thing following the double slashes would have to be a valid hostname, not a local file path; you’d use the file protocol to access local files, like file:///path/to/file (you use three slashes because it’s on the localhost).

– Dan


No, that isn’t the actual path. It points to an actual php file on my domain. I can run the script manually from a web browser and it works.


Wanted to follow up on this since it’s not working for me either…

  1. fom the shell…

lynx -dump >/dev/null

…works fine.

  1. saving the cron job as…

59 23 * * * lynx -dump >/dev/null

…results in a “Errors in crontab: Bad Day of Month” error message

  1. I can successfully save the cron job as…

59 23 * * * lynx -dump

  1. I get a generic lynx help page sent to my email address, and the page is never being hit.

I’ve searched through the lynx man and there does not appear to be any other switched required.

Is there some strange interaction between lynx and cron I’m missing??


I think this is maybe because $TERM isn’t set when cron runs lynx? There are some workarounds for this if you google around. You might want to try curl or wget or something.


Thanks for the reply, Will. I did some more experiementing and finally got it to work with wget. Woot!

Here’s an observation that may or may not be relevant, I’ll need to go back in and test vs. lynx and curl.

wget initially failed but gave me the error message that the URL was missing. Neither lynx nor curl gave an informative error message.

I truncated the length of the URL by renaming the file on my server so that the “cron_time_setting wget url” fit on one line. Lo and behold, it worked.

My best guess is that the default editor line wraps were messing with wget, curl, lynx though crontab didn’t seem to care.


The default editor might be nano (pico clone) on your system. You could try setting $VISUAL [1] to:

“nano -w” (or “nano -tw”; you may have to play around with the quoting a little), or else just set it to nvi or emacs if you know how to use one of those editors.

[1] To set $VISUAL:

[bash, zsh, ksh]
export VISUAL=foo

[tcsh, csh]
setenv VISUAL foo