I have a crontab like this for root user:
9 17 * * * TERM=xterm /bin/bash /root/htop_stat.sh
/usr/bin/echo q | /usr/bin/htop -C | /usr/bin/aha --line-fix | /usr/bin/html2text -width 999 | /usr/bin/grep --line-buffered -v "F1Help\|xml version=" > /tmp/htop.txt
If I manually run
htop_stat.sh as root, it works fine.
However, when the above cronjob kicks in, htop.txt only has the first 23 lines of htop's output.