This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / cron job question, thanks我有一个crontab running every minutes to check one status. If the status is "fail", then it should send out an email. My question is that I only want the cron jon to send out one email, instead of sending out one email every minute. any ideas? thanks
-waiting(OK);
2008-1-22
{253}
(#4206101@0)
-
how about using a flag file?
-win(秋天的菠菜);
2008-1-22
(#4206118@0)
-
thanks
-waiting(OK);
2008-1-22
(#4206166@0)
-
啊哈,原来是IT manager
-vetra(豆泡松果 之 多泡泡);
2008-1-22
(#4206177@0)
-
ah ? there will be a promotion?
-win(秋天的菠菜);
2008-1-24
(#4207625@0)
-
加拿大真是浪费人才
-vetra(豆泡松果 之 多泡泡);
2008-1-24
(#4211308@0)
-
但是不是还要人工删除这个flag呢?否则永远不再发email了
-akoei(停车**枫林晚);
2008-1-23
(#4210323@0)
-
When the status is OK and the file exists, then remove the file.
-waiting(OK);
2008-1-24
(#4211117@0)
-
create a flag file with last sending timewhen send out email, write to this flag file, then cronjob will check this file before send the mail, you can setup a threshold like 2 hours, the cronjob will check if last email send time is over 2 hours, then send otherwise not
-likeuclinux(siyuan);
2008-2-11
{229}
(#4254708@0)
-
two cron jobs, one for check status and save into file. another check the file and send email. the second one has longer interval.
-647i(流浪的步行万里);
2008-1-22
(#4207919@0)
-
把出错的信息写到日志文件,第一个cron,查看是否日志文件存在,不存在就send email,存在就append,第二个就是send email ,清除日志文件
-vetra(豆泡松果 之 多泡泡);
2008-1-24
(#4211389@0)
-
记得cron源程序里面是可以设定通知的方式设定为仅仅通知一次的。
-frankwoo(柳五随风);
2008-2-11
(#4254960@0)