无法从crontab-cat:0652-050-unix AIX中复制文件

无法从crontab-cat:0652-050-unix AIX中复制文件,cron,sendmail,aix,Cron,Sendmail,Aix,我正在尝试在unix AIX中使用sendmail实用程序发送电子邮件。什么时候 邮件头: To: to@gmail.com From: from@gmail.com MIME-Version: 1.0 Content-Type: text/html; charset=us-ascii Subject: Alert status.hmtl->包含使用db查询假脱机的html报告 cat./mailheader./status.html | sendmail-t 当我尝试从crontab选项

我正在尝试在unix AIX中使用sendmail实用程序发送电子邮件。什么时候

邮件头:

To: to@gmail.com
From: from@gmail.com
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Subject: Alert
status.hmtl->包含使用db查询假脱机的html报告

cat./mailheader./status.html | sendmail-t

当我尝试从crontab选项卡的shell脚本中使用上述命令时,我在日志中得到以下消息:

类别:0652-050无法打开。/mailheader。 类别:0652-050无法打开。/status.html

但是当我手动运行shell脚本时,它运行得非常完美


请让我知道你的想法

使用绝对路径,如

(cat /there/mailheader /there/status.html ) | sendmail -t
或者使用cd

但首先,调试。将以下行添加到脚本中:

set -xv
exec >>/tmp/debug.$$ 2>&1
date
pwd
id -a
env

我没有从crontab更改目录,因此我得到了错误


使用绝对路径和调试来解决问题,并在我的脚本开始时添加了cd来解决问题。

您的cron脚本是否将chdir放入适当的目录中?显然我错过了这个目录。这个问题现在已经解决了。非常感谢。
set -xv
exec >>/tmp/debug.$$ 2>&1
date
pwd
id -a
env