[SATLUG] help with webadmin and a scheduled chron job

John D Choate jdchoate at gmail.com
Fri May 22 20:19:55 CDT 2009


On Friday 22 May 2009 19:42:12 Todd W. Bucy wrote:
> I wrote a nifty little script that runs various sytem reports and
> outputs the data to a html document.  I know that the code is good as I
> have tested it several times at the command line.  I am using webadmin
> for most of my administrative tasks on my home server and am therefore
> trying to set the job to run daily at midnight under the Scheduled Chron
> Jobs tab.  Problem is when I test the command
> "~/scripts/system_report.sh"  I get the following output:
> "Output from command /home/redpill-master/scripts/system_report.sh ..
> TERM environment variable not set."
> 
> can someone point me in the right direction? 
> 
> thanks
> Todd
> 
> 

I did the exact same thing on a server for my boss. I am not sure about the 'TERM environment variable not set.' error. But in webmin, I did set the script to be run as root from a user directory. 
In addition to the text files generated by the script, I also made other text files which have comments to precede each result. I had used asciidoc to translate the results into html, but the formatting sucked. So I made a couple of text files with the html headers and closing code. Everything is stitched together with cat and then copied to html.

#!/bin/bash
iptables=/sbin/iptables
uname -a | cat > /var/www/html/up02b.txt;uptime | cat > /var/www/html/up03b.txt;cat /proc/meminfo > /var/www/html/up03d.txt;mpstat | cat > /var/www/html/up04b.txt;iostat | cat > /var/www/html/up05b.txt;pidstat | cat > /var/www/html/up06b.txt;$iptables -L -v -n | cat > /var/www/html/up07b.txt;cat /var/www/html/up0*.txt > /var/www/html/uptime.txt;cp -rf /var/www/html/uptime.txt /var/www/html/uptime.html
#;asciidoc /var/www/html/uptime.txt

I hope something here helps.


More information about the SATLUG mailing list