Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/245.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 定时重击(at)运行,但抛出错误_Php_Bash_Scheduled Tasks_Scheduler - Fatal编程技术网

Php 定时重击(at)运行,但抛出错误

Php 定时重击(at)运行,但抛出错误,php,bash,scheduled-tasks,scheduler,Php,Bash,Scheduled Tasks,Scheduler,我有一个命令行应用程序,其中我需要实现某种调度器,以便在执行第一个脚本后运行一次脚本 现在,我尝试在执行时间后一分钟运行脚本,使用以下指令: $dir = getcwd().'/'; exec('echo '.$dir.'./prices get:inventorylist '.database_connector::getUserId().' '.database_connector::getLand().' --reportId="'.$this->reportRequest

我有一个命令行应用程序,其中我需要实现某种调度器,以便在执行第一个脚本后运行一次脚本

现在,我尝试在执行时间后一分钟运行脚本,使用以下指令:

$dir = getcwd().'/';

    exec('echo '.$dir.'./prices get:inventorylist '.database_connector::getUserId().' '.database_connector::getLand().' --reportId="'.$this->reportRequestId.'" | /usr/bin/at now + 1 min');
当尝试在没有echo和usr/bin/at now+1分钟的情况下运行此程序时,它运行得非常好,没有抛出任何错误,我还检查了at是否正常工作,并且应该正常

实际上,脚本是在给定的额外时间后执行的,但我在syslog中一直遇到这个错误:

Jan 23 19:09:01 atd[6792]: Exec failed for mail command: No such file or directory.
我无法理解这个错误,因为正如我上面提到的,当我在没有at的情况下运行它时,脚本正在运行,指令正在运行,没有任何问题或错误


我不明白为什么会抛出此错误吗?

您是否缺少
/usr/sbin/sendmail
或其他信息


该错误是
at
告诉您它无法使用它运行的命令的输出发送邮件,我相信。

at是否配置为发送输出邮件?at的
配置是否有问题?您是否缺少
/usr/sbin/sendmail
或其他信息?你确定任务没有运行,即使
at
给出了错误吗?不,任务正在运行,但我想你已经用at-mail配置给了我答案。我会看看这个,我很确定就是这个。谢谢@EtanReisner@EtanReisner再次感谢你!就是这样!