6

crontab不再发出告警邮件

 1 year ago
source link: https://abcdxyzk.github.io/blog/2023/06/24/tools-crontab/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

http://blog.chinaunix.net/uid-405749-id-2949218.html

在默认情况下,cron程序会向用户的本地信箱中发送邮件,则产生的邮件数量将会很巨大,那么如何禁用邮件报警功能呢,解决方法有如下一些:

不装邮件时 保存到 /var/spool/mail/root

装邮件时 保存到 /root/Maildir/new/

1.将执行命令的信息重定向到

cron_command >/dev/null 2>&1

2.将执行命令的信息重定向到

cron_command &>/dev/null

3.在crontab设置文件中指定发送到空

MAILTO=""
cron_command

在crontab设置文件中指定发送到邮件

MAILTO="[email protected]"
cron_command

Recommend

  • 63

    crontab,chkconfig,system service,unit,target

  • 102

    Linux系统的定时任务是由cron(crond)这个系统服务来控制的。Linux系统上面原本就有非常多的计划性工作,因此这个系统服务是默认启动的。另外,由于使用者自己也可以设置计划任务,所以,Linux系统也提供了使用者控制计划任务的命令:crontab命令。一、crond简介crond...

  • 53

    20.23-20.25告警系统邮件引擎mail.py文件内容如下#mail目录下创建mail.py文件#!/usr/bin/envpython#-*-coding:UTF-8-*-importos,sysreload(sys)sys.setdefaultencoding('utf8')importgetoptimportsmtplibfromemail.MIMETextimportMIMEText

  • 81

    Linux - @Hopetree - 先说我的系统,是 Ubuntu 16.04然后我要运行一个定时任务,所以为了测量定时任务是否执行,先运行一个最基本的测试,但是发现根本没运行。我的做法:- 使用 crontab -

  • 47

    一、问题现象 业务反馈某台应用服务器,普通用户使用mutt程序发送邮件时,提示“postdrop warning: mail_queue_enter: create file maildrop/713410.6065: Permission denied”,而且普通用法使用crontab -e 编辑自身任务计划时,也...

  • 75

    作为程序员,在日常工作中免不了与各种任务打交道,有一些任务的执行是具有重复性质的,比如工作人员每天登录系统之后进行一系列基础操作: ...

  • 34

  • 52
    • www.tracefact.net 6 years ago
    • Cache

    linux上配置计划任务(cron和crontab)

    很多时候,我们需要定时执行某个应用或者某段脚本,在linux上,可以使用cron服务,它有点类似于Windows上的任务计划程序。这篇文章将简单介绍cron的使用。 crond和crontab 首先需要分清楚两个概念:crond和crontab。c...

  • 6

    如何更改crontab任务结果的邮件接收人 crond 的手册说明中有这么一段话 Cron examines all stored crontabs and checks each job to see if it needs to be run in the current minute. When executing commands, any out...

  • 6

    F5-Bigip的Load Balance告警邮件设置 2024-01-18 1 分钟阅读 F5-Bigip负载均衡设备,在我们的生产环境,用于分发前端的请求,如果后端的成员离线了,需要及时得到通知。 规则是:load balance池子里的成员如果离线,就发...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK