Hi Guys,
I have a short script that runs squid analyzer and mails me a simple confirmation that it ran ok. Just for fun I added a python script that draws a little graphic. All works fine when I run it manually, but when I run it as a cron job it doesn't draw the graphic. I've tried adding a wait 10 seconds after executing the python script but it doesn't make any difference. Like I said, It's just for fun and not important, but I would like to know what I might be doing wrong?
Here's the script:-
and here's what I get when I run it as a cron job:-
I have a short script that runs squid analyzer and mails me a simple confirmation that it ran ok. Just for fun I added a python script that draws a little graphic. All works fine when I run it manually, but when I run it as a cron job it doesn't draw the graphic. I've tried adding a wait 10 seconds after executing the python script but it doesn't make any difference. Like I said, It's just for fun and not important, but I would like to know what I might be doing wrong?
Here's the script:-
Code:
#!bin/bash
{
echo
cd /usr/local/bin/
squid-analyzer
echo
python /home/ahounsome/bin/progressbar.py 10 50
echo
echo "squid-analyzer reports generated ok"
echo "click here to access reports http://tinman/squidreport"
} | mail -s "squid-analyzer reports generated ok on tinman" andyhounsome@gmail.$
Code:
and here's the output from the generated email when run manually:-
[ ] 0%
[===== ] 10%
[========== ] 20%
[=============== ] 30%
[==================== ] 40%
[========================= ] 50%
[============================== ] 60%
[=================================== ] 70%
[======================================== ] 80%
[============================================= ] 90%
[==================================================] 100%
squid-analyzer reports generated ok
click here to access reports http://tinman/squidreport
and here's what I get when I run it as a cron job:-
Code:
squid-analyzer reports generated ok
click here to access reports http://tinman/squidreport