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
0 comments
Kick things off by filling out the form below.
Leave a Comment