I have this strange mails comming from cron:

Return-Path: <root@domain.com>
Delivered-To: root@domain.com
Received: by domain.com (Postfix, from userid 0)
    id 6F944264D0; Mon, 10 Jan 2011 10:35:01 +0000 (UTC)
From: root@domain.com (Cron Daemon)
To: root@domain.com
Subject: Cron <root@domain> lynx -dump http://www.domain.com/cron/realqueue
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20110110103501.6F944264D0@domain.com>
Date: Mon, 10 Jan 2011 10:35:01 +0000 (UTC)

/bin/sh: lynx: not found

I have this cron settings in crontab file:


*/5 * * * * lynx -dump http://www.domain.com/cron/realqueue

17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

Lynx is installed on my Ubuntu as well.

Ofc in place of domain.com is my domain, just replaced.

Thanks ;)


You should check to make sure the lynx binary is in one of the locations specified in the PATH variable, or use the full path to the binary in the cron line. To surpress the errors, you want to redirect STDERR and STDOUT to /dev/null, like so:

*/5 * * * * lynx -dump http://www.domain.com/cron/realqueue >/dev/null 2>&1

The first redirection sends STDOUT to /dev/null, and the second sends STDERR with STDOUT (that is, to /dev/null).


The real issue here is this:

/bin/sh: lynx: not found

This is saying that lynx isn't found, and so that line in your crontab isn't even being run. Suppressing the errors using the redirection suggestions from Scrivener or blueben, you've just hidden the fact that the command you want to actually run isn't being run.

In general, cron will send those emails for error messages. The best way to suppress the emails is to fix the errors, and only if you can't fix the errors (eg, the script is always noisy) should you start to redirect output to /dev/null.

  • You didn't help him fix lynx or answer his question. – blueben Jan 12 '11 at 18:33
  • 1
    Fair call. Other answers (scrivener, nicola) have suggested ways to fix that though. I was really pointing out that blindly suppressing error notifications is not a fix. – Daniel Lawson Jan 12 '11 at 21:36

Add MAILTO to the top of your crontab and set it to a null string:


You want:

*/5 * * * * lynx -dump http://www.domain.com/cron/realqueue >> /dev/null 2>&1

  • -1 for blindly suggesting the OP redirect to /dev/null when it's clear that his command isn't even being run. Fix errors first, then clean up output – Daniel Lawson Jan 12 '11 at 17:37
  • 2
    You're giving me -1 for answering his actual question? Vicious, man. – blueben Jan 12 '11 at 18:33

If you want the path to the lynx binary, the simplest command is which lynx.

That should give you something like /usr/bin/lynx


maybe the lynx binaries are not registered in $PATH.

try this in your shell:

# locate lynx

it'll return some strings. Choose the one leads to lynx binaries and then do

# export PATH=$PATH:{the firstly returned string path until last dir}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.