From owner-freebsd-questions@freebsd.org Fri Sep 11 21:46:27 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 4F71C3E7A94 for ; Fri, 11 Sep 2020 21:46:27 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp8TZ3wlmz3fXR for ; Fri, 11 Sep 2020 21:46:26 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wr1-x42d.google.com with SMTP id z4so12825770wrr.4 for ; Fri, 11 Sep 2020 14:46:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SH9w4mPh42+ta6fLANvk4epdBlBm65a/rZ3+vi3OA7Q=; b=cbDmuRY4cUeoMcsWWTB01wdMRXl71DQvvGt58MhZ3jrNtH+bGhi6MZAxj1IDUtPlGW K0ICAlEb/9jGfC+S+m12Msfg0QMe16AJMWZZ6oXeYWc6b0YRshe7h4E93GYOQgWDzCvP x8jl5Bh0UCxHEIUXKTgcdEeue67jI2zd7i2DcK4BIMzvI6zZ8H1iuiItnwfmqe8jn7TL o178bJeLL4r/9fqzLGpmfxB2EHetHxTYreuUUj8ohemkqxrpmCI3g1MS96DFPIWkGKGf nLcHenV4gGaOwcf2PY8vrdPnmRGOdjUVYTElvY65o7MsV9hSF28bmvqxNe2guo79VDse 42bA== X-Gm-Message-State: AOAM530ITBtQNDgfgK7FuSotFhe/EH0ftI7eFJH1n+VoBe7hONiOwE6V PMDcrg7fuprmBzdhm7z4Who3hZHEW8Q= X-Google-Smtp-Source: ABdhPJzzO+xJpOXmU8gDHbqHpH+S40qF16yqOyuH8wvefLKOCcRcsMudiDKVbhIi/pvOi60lA14f/g== X-Received: by 2002:adf:efc9:: with SMTP id i9mr4132957wrp.187.1599860784077; Fri, 11 Sep 2020 14:46:24 -0700 (PDT) Received: from gumby.homeunix.com ([2.219.101.66]) by smtp.gmail.com with ESMTPSA id z14sm6602621wrh.14.2020.09.11.14.46.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 14:46:23 -0700 (PDT) Date: Fri, 11 Sep 2020 22:46:19 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: How to silence cron? Message-ID: <20200911224619.4a134d23@gumby.homeunix.com> In-Reply-To: References: X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bp8TZ3wlmz3fXR X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[googlemail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[googlemail.com:+]; DMARC_POLICY_ALLOW(-0.50)[googlemail.com,quarantine]; NEURAL_HAM_SHORT(-0.66)[-0.658]; RECEIVED_SPAMHAUS_PBL(0.00)[2.219.101.66:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[googlemail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[googlemail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.76)[-0.761]; R_DKIM_ALLOW(-0.20)[googlemail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.979]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::42d:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] 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 21:46:27 -0000 On Fri, 11 Sep 2020 15:11:49 +0200 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. > Have you tried SHELL=/bin/sh */5 * * * * su -m www -c "/usr/local/bin/php /usr/local/www/pathtoscript.php" >/dev/null 2>&1 the redirection has to take place under a bourne-compatible shell, so outside of the quotes. On Fri, 11 Sep 2020 19:44:17 +0100 tech-lists wrote: > I *think* you can set MAILTO: to /dev/null but I'm not 100% sure. But > if you can, I think it'll do what you want, if that is to have no > mail at all for www user. Crontab variable assignments apply to the lines below the assignment. It should be possible to divide the crontab into sections with different MAILTO values.