From owner-freebsd-questions@freebsd.org Fri Sep 11 18:21:08 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F71D3E228A for ; Fri, 11 Sep 2020 18:21:08 +0000 (UTC) (envelope-from xtouqh@mm.st) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp3wg6L17z4gDX for ; Fri, 11 Sep 2020 18:21:07 +0000 (UTC) (envelope-from xtouqh@mm.st) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E3B8A5C01E3; Fri, 11 Sep 2020 14:13:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 11 Sep 2020 14:13:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mm.st; h=subject :to:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=fm1; bh=BBpL8RNDWUGv1 geASo/PbQuy6bl2Fel+S4BvCWSshmk=; b=OWPrSlAvZaV0FDggERFQrREIt9aMA sKDvIs6Z03s+1U32Vj5C5WXszAfhzxs3heGW24XVajjBeS9ZaDJ0/LBE+xDUYfWg JOFnNm55AU7qQhpD+ddqXOJ85isrjXcLJZWZedpZ/WbVxqurke2Ow2UNh/oTDA8G Fo+btV6c8IPVw3nbpjlbFQZgr6aaJUt8o2ZBOS5ttjcqSQAXf6h2F6Q4XEzFQHZG SofmaiQ+MWHCitruJQDzEBLSD/IO3xXw1e8mS+tkR2yQwj30tdyOAkSn9CH+HPZn hak2Uhp/W8aLpDY33Z2dzUJThHgbyTk70C2x+j3XBh5JMae1kEhbfM/6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=BBpL8RNDWUGv1geASo/PbQuy6bl2Fel+S4BvCWSsh mk=; b=LkG5svnxT9gDrk412cc9ZyW3S5SbC1U2IKIGdzOLgXIU33M19OOddxMQt QP/831mAKFcvWopMzhXE0wuxQ9rwbIl+/2HdlC6nSCHg+wgLPfMWmbA3Bahk4bpt 5hFb+pG74sKab6auKKP0EYHMbEkO2ie5cb+9fVl3i5aoNDmo8DzUXCQV2sLvwmad i5b081k/gNDXTqx6IozAUBvJjk48bivdGs8sRyfZVoCW9Leh6SXLKPdiAH+E6IAJ KyB1toQGcWXFDP057BGSmev7SqMKJ8Ej/B2BxKZC+pUL25xj5lv1Ql0LRlWLiOfp DQG0/tYfkojV64oPx1ykxv6KLmPSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehledguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeehnecuhfhrohhmpeigthho uhhqhhesmhhmrdhsthenucggtffrrghtthgvrhhnpeeujeeghedujeekheetfeekkeekve eileelueefueffieejjeeuheeigfduheeukeenucfkphepledurddvgedtrdduvdegrddu ledtnecuufhprghmkfhppfgvthifohhrkhepledurddvgedtrdduvdegrdduledtnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepgihtohhuqhhh sehmmhdrshht X-ME-Proxy: Received: from mercury.lan (unknown [91.240.124.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 04733328005E; Fri, 11 Sep 2020 14:13:06 -0400 (EDT) Subject: Re: How to silence cron? To: Per olof Ljungmark , freebsd-questions@freebsd.org References: <41377ad1-4162-1194-7172-234c4d172e6d@mm.st> <20200911153307.690190ed@gumby.homeunix.com> <20200911143949.GE91422@bastion.zyxst.net> <50422f0c-0acd-5847-ed11-e5f505b10a24@nethead.se> From: xtouqh@mm.st Message-ID: Date: Fri, 11 Sep 2020 21:13:04 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <50422f0c-0acd-5847-ed11-e5f505b10a24@nethead.se> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Bp3wg6L17z4gDX X-Spamd-Bar: +++++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mm.st header.s=fm1 header.b=OWPrSlAv; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=LkG5svnx; dmarc=pass (policy=none) header.from=mm.st; spf=pass (mx1.freebsd.org: domain of xtouqh@mm.st designates 66.111.4.28 as permitted sender) smtp.mailfrom=xtouqh@mm.st X-Spamd-Result: default: False [11.86 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:66.111.4.28:c]; FREEMAIL_FROM(0.00)[mm.st]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.28:from]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[mm.st:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(0.00)[mm.st,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[mm.st]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.28:from]; SUBJECT_ENDS_QUESTION(1.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[91.240.124.190:received]; R_DKIM_ALLOW(0.00)[mm.st:s=fm1,messagingengine.com:s=fm3]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_CSS(4.00)[91.240.124.190:received]; NEURAL_SPAM_SHORT(0.08)[0.081]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.90)[0.897]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.99)[0.985]; FROM_NO_DN(0.00)[]; GREYLIST(0.00)[pass,body]; MAILMAN_DEST(0.00)[freebsd-questions] X-Spam: Yes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 18:21:08 -0000 Per olof Ljungmark wrote: > On 2020-09-11 16:39, tech-lists wrote: >> On Fri, Sep 11, 2020 at 03:32:40PM +0100, RW via freebsd-questions wrote: >>> On Fri, 11 Sep 2020 16:22:22 +0300 >>> xtouqh@mm.st wrote: >>> >>> >>>> crontab(5) describes -n, which will silence only the successful runs, >>>> i.e: >>>> >>>> */5 * * * * -n su -m www -c "...." >>> >>> >>> Where does it say that in crontab(5)? >> >> man 5 crontab[1], a couple of pages down: >> >> [...] >> >>      The following command options can be supplied: >> >>       -n      No mail is sent after a successful run.  The execution >> output >>               will only be mailed if the command exits with a non-zero >> exit >>               code.  The -n option is an attempt to cure potentially >> copious >>               volumes of mail coming from cron(8). >> >>       -q      Execution will not be logged. >> >> [...] >> >> [1] FreeBSD 13.0-CURRENT #0 r365391M: Tue Sep  8 23:06:14 BST 2020 > > This is 11-STABLE, it's got -n but not -q. > > Thank you all for answering. However, when I try > */5 * * * * -n su -m www -c "...." > > I get "/bin/sh: -n: not found" > More quotes? Works for me on -CURRENT, I have added '-n echo test' for user and '-n su -m www -c id' for root crontabs, and got no mail, while seeing the commands are executed in /var/log/cron, and both had output. Wonder if something is wrong with 11-STABLE backport, might be worth asking on stable@ if someone else could confirm the issue?