一个bash脚本在crontab中执行。每次运行时,都会通过电子邮件发送以下错误信息:
脚本的功能正常,但错误邮件在收件箱中不断增加。该如何解决此错误?
/opt/Informatica/pcdev/scripts/startworkflow_trg.sh: line 1: #!/bin/bash: No such file or directory
以下是crontab中的内容:
# Check queue and start corresponding processes in test
* * * * * (. ~/.bash_profile; $HOME/scripts/startworkflow_trg.sh tst)
脚本的功能正常,但错误邮件在收件箱中不断增加。该如何解决此错误?
echo $HOME
的输出是什么? - prado~
修改为$HOME
,去掉不必要的括号并将分号替换为&&
。 - Mark Setchell