Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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 如何防止通过电子邮件发送的cron输出_Php_Codeigniter_Cron - Fatal编程技术网

Php 如何防止通过电子邮件发送的cron输出

Php 如何防止通过电子邮件发送的cron输出,php,codeigniter,cron,Php,Codeigniter,Cron,我正在使用一个cron来访问一个URL来运行一个预定的进程。我不断收到成功的电子邮件。。。如果wget请求失败,有没有办法让我只收到电子邮件 工作组2>和1 (请注意,空响应不是失败。)如果您在cron设置中直接运行wget,则不会。您不能有条件地重定向输出。但是,您可以将wget命令放入shell脚本中,并在其中执行条件 #!/bin/sh OUTPUT=`wget .... 2>1` if [ $? != 0 ] echo $OUTPUT fi wget-q;如果你根本不想要

我正在使用一个cron来访问一个URL来运行一个预定的进程。我不断收到成功的电子邮件。。。如果wget请求失败,有没有办法让我只收到电子邮件

工作组2>和1


(请注意,空响应不是失败。)

如果您在cron设置中直接运行wget,则不会。您不能有条件地重定向输出。但是,您可以将wget命令放入shell脚本中,并在其中执行条件

#!/bin/sh

OUTPUT=`wget .... 2>1`
if [ $? != 0 ]
   echo $OUTPUT
fi
wget-q;如果你根本不想要输出!
#!/bin/sh

OUTPUT=`wget .... 2>1`
if [ $? != 0 ]
   echo $OUTPUT
fi