I'm trying to setup crontab job to email some statistic.

cat /tmp/send.sh 
#!/bin/bash
#we send stat for previous day
mail_to="user1 at company1.ca"
copy_to="user2 at company1.ca"
zstor=`hostname`
cdate=`date --date='1 days ago' +%d%m%Y`
printdate=`date --date='1 days ago' +%d/%m/%Y`
uuencode /tmp/iscsistat_$cdate  stat_$cdate.txt | mailx -c "$copy_to" -s "Iscsi 
usage stat on the server $zstor for $printdate" $mail_to

When executed from command line - it works fine. I'm getting mail with the 
subject: "Iscsi usage stat on the server zsan01 for 19/11/2009"

When executed from cron, I'm getting an empty message with the subject:
"Iscsi usage stat on the server zsan01 for"

Seems like $printdate is empty and there is no file attached.

Why is this happening?

--
Roman
-- 
This message posted from opensolaris.org

Reply via email to