A Stefan Klopp Weblog
Random header image... Refresh for more!

Top not working via Cron

For the past few days I have been banging my head against a wall as to why top would not give any output when run from cron. When the same script was run via the command line it worked fine, however via cron no output. I finally found out that top wants to know a terminal, or else it dies not so graciously. So to fix the problem simply put:

TERM=vt100

In front of your top command and all should be well. So my call looks something like:

TERM=vt100 /usr/bin/top -b -n 3 -d 3

Related Posts

  • No Related Post

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment