From owner-freebsd-questions@freebsd.org Fri Sep 11 13:31:15 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 7164A3DA53A for ; Fri, 11 Sep 2020 13:31:15 +0000 (UTC) (envelope-from xtouqh@mm.st) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 4BnxVC0GCZz4Ll2 for ; Fri, 11 Sep 2020 13:31:14 +0000 (UTC) (envelope-from xtouqh@mm.st) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id AC895433; Fri, 11 Sep 2020 09:22:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 11 Sep 2020 09:22:25 -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=toyTsZF46pBUY aBz8ma4O1+65YO+icSbyMBsucdFf74=; b=VekIQIlLS8DLyDcKvDPaYx4d+WeBs nu2iMWbCPykXmoXMXJY8px8CizkpqfT9j9uF8fnE/+JaN+QzF04DSPMmyjgjqu21 ubiFK34rWaz2p8YgdNHoOgYD7Mw4GGsLVcgmDvanIKFVReqCMGKWWnMOKVe2UCmA Lv+RzV1jFiyyNXHjM5vY32J89GsyMdwTGtRIphhdYCr5lrxUmC8qBgW0ph/bycDh TRcdk37az/DXRvvB5iM6VXrdB4MXWxPsJoeDnct1tNoKayvR2nM4QLnxiQ5XGIvE Gt4BaQU2wYKLNYOKcz0N2vuldJMT2G5kLDJrYmTc0WZ7Upwoc3pM92E8g== 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=toyTsZF46pBUYaBz8ma4O1+65YO+icSbyMBsucdFf 74=; b=Oj2N3G2Y5XGiMVc8K49QpSV3DSHzwlqx78ISwEWFEr2cWALR2JpZaFwQt 1zpWK5rF5XzQDoBsUGqY6IcUh/ko2VkAc1Q+5C+2++KIIivQx5GIF8T1j0jUQANy aENoiIEFd6WcDbf5LKXrVjnQpvOTmSmKDfz/2MUaHaEwy5YbS1X8sjhluLxCzOf+ pa9NIA5FhQOaBXeP+iXdHHPV3xrG61w4Rk6WicSAT6WKZZ/V2NpbrqI1lYHFL6qz 3cn/4V5cTPWq4Bm7yo9wkPYqP4WrN4VJvsldEsmLCLPbDR7v+klGjmsaNMSsnv7O wk9EXfZ665T8CNzmisBsR/qfVXTZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehledgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepgihtohhu qhhhsehmmhdrshhtnecuggftrfgrthhtvghrnhepiefhieefudejteevheegleehtdffgf etleetjeefkefhgfelgfegkeetffethfejnecukfhppeeluddrvdegtddruddvgedrudel tdenucfuphgrmhfkphfpvghtfihorhhkpeeluddrvdegtddruddvgedrudeltdenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeigthhouhhqhhes mhhmrdhsth X-ME-Proxy: Received: from mercury.lan (unknown [91.240.124.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 6F3113280059; Fri, 11 Sep 2020 09:22:24 -0400 (EDT) Subject: Re: How to silence cron? To: Per olof Ljungmark , FreeBSD Mailing List References: From: xtouqh@mm.st Message-ID: <41377ad1-4162-1194-7172-234c4d172e6d@mm.st> Date: Fri, 11 Sep 2020 16:22:22 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BnxVC0GCZz4Ll2 X-Spamd-Bar: +++++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mm.st header.s=fm1 header.b=VekIQIlL; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=Oj2N3G2Y; dmarc=pass (policy=none) header.from=mm.st; spf=pass (mx1.freebsd.org: domain of xtouqh@mm.st designates 64.147.123.24 as permitted sender) smtp.mailfrom=xtouqh@mm.st X-Spamd-Result: default: False [11.65 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:64.147.123.24:c]; FREEMAIL_FROM(0.00)[mm.st]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[mm.st:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(0.00)[mm.st,none]; NEURAL_HAM_SHORT(-0.23)[-0.231]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.24:from]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[mm.st]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[91.240.124.190:received]; R_DKIM_ALLOW(0.00)[mm.st:s=fm1,messagingengine.com:s=fm3]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_CSS(4.00)[91.240.124.190:received]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(1.07)[1.075]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.90)[0.902]; FROM_NO_DN(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[64.147.123.24:from]; 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 13:31:15 -0000 Per olof Ljungmark wrote: > Hi, > > What would be the proper way to silence output from a php script running > under cron? I have tried variations of /dev/null and 2>&1 but getting > nowhere. > > Abbriviated crontab looks like > > SHELL=/bin/sh > PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin > MAILTO="someimportantperson" > > */5 * * * * su -m www -c "/usr/local/bin/php > /usr/local/www/pathtoscript.php" > > Roots shell is FBSD standard csh > www's shell is /usr/sbin/nologin > > With the rest of the crons I do want mail to be sent, just not this one. crontab(5) describes -n, which will silence only the successful runs, i.e: */5 * * * * -n su -m www -c "...." If that works for you, good. If not, how *exactly* you used the redirections?