cron作业中提供的条件返回"没有这样的文件或目录"

aus*_*ney 6 bash cron redhat

我试图在cron作业中执行此代码:

a=`/home/mailmark/node/bin/forever list`; if [ "$a" == "No forever processes running" ]; then forever start /api.js; fi
Run Code Online (Sandbox Code Playgroud)

有问题的文件'永远'包含这个shebang:

#!usr/bin/env node    
Run Code Online (Sandbox Code Playgroud)

它返回此响应:

/usr/bin/env: node: No such file or directory
Run Code Online (Sandbox Code Playgroud)

但我在.bashrc文件的最后一行有这个代码:

export PATH=/home/mailmark/node/bin:$PATH
Run Code Online (Sandbox Code Playgroud)

我该怎么做让我的cron工作?

edu*_*ffy 3

cron不在“登录 shell”中运行,因此.bash_profile.bashrc不会被加载。