如何防止电子邮件cron输出 [英] How to prevent emailed cron output

查看:119
本文介绍了如何防止电子邮件cron输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的cron访问URL来运行调度的进程。我不断收到成功的电子邮件...是否有一种方法,只有在wget请求失败时,我才能收到电子邮件。

I'm using a cron that gets accesses a URL to run a scheduled process. I keep getting successful emails... is there a way for me to only get emails if the wget request fails?

wget http://www.domain.com/cron/dailyEmail 2>& 1;

wget http://www.domain.com/cron/dailyEmail 2>&1;

推荐答案

wget --quiet http://www.domain.com/cron/dailyEmail || echo "wget failed"

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

(Note that an empty response is not a failure.)

这篇关于如何防止电子邮件cron输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆