[Gllug] crontab

Tethys tet at accucard.com
Thu Jul 3 17:20:52 UTC 2003


"Simon Faulkner" writes:

>What syntax do I need?
>
>4,14,24,34,44,54 * * * * /usr/bin/fetchmail 2&1> /dev/null

It depends what you're trying to do, but that syntax won't get you
very far. It looks like you're trying to redirect stderr to /dev/null.

Firstly, this isn't desirable. You *want* to know about any errors.
Secondly, the syntax is wrong anyway. If you wanted to just do stderr,
you'd use:

	/usr/bin/fetchmail 2> /dev/null

If you want to do both stdout and stderr, you'd do:

	/usr/bin/fetchmail > /dev/null 2>&1

This says to redirect stdout to /dev/null, and redirect stderr to the
same place that stdout is currently going. Thus the order is important:

	/usr/bin/fetchmail 2>&1 > /dev/null

means something completely different. What I suspect you want to do
is just redirect stdout, so you don't get mail under normal operation,
only when it goes wrong. You could do this with a redirection:

	/usr/bin/fetchmail > /dev/null

but the easiest way it to just tell fetchmail to run in silent mode.
If you're running it via cron, you probably want to add a timeout as
well, so that you don't get multiple instances running concurrently:

	/usr/bin/fetchmail -s --timeout=180

Tet

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list