Re: Something Odd - "top" Delivers Nada When Run By Crontab

Eli the Bearded <*@eli.users.panix.com>
Newsgroups comp.os.linux.misc
Organization Some absurd concept
Message-ID <[email protected]>
In comp.os.linux.misc, c186282  <[email protected]> wrote:
> Run the script from the CL and it works perfectly.
> 
> Run it via root crontab though and the top redirect
> file exists, but is EMPTY.

The environment variables for cron jobs are usually nearly empty.
Anytime something works from the shell but not from cron, check
environment variables.

Here's a tip: your cron scripts should work with _no_ environment
variables at all. To run them that with, use `env -i`. When I run
`env -i top` I get _no_ output at all.

The "-b" option suggested in another post fixes the no output problem.

Elijah
------
top probably wants $TERM set when not in batch mode
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.