From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7EF7C54EE9 for ; Tue, 13 Sep 2022 18:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbiIMSTd (ORCPT ); Tue, 13 Sep 2022 14:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232124AbiIMSTQ (ORCPT ); Tue, 13 Sep 2022 14:19:16 -0400 Received: from rin.romanrm.net (rin.romanrm.net [51.158.148.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58BE080E8C for ; Tue, 13 Sep 2022 10:30:13 -0700 (PDT) Received: from nvm (nvm2.home.romanrm.net [IPv6:fd39::4a:3cff:fe57:d6b5]) by rin.romanrm.net (Postfix) with SMTP id 1142250A; Tue, 13 Sep 2022 17:30:10 +0000 (UTC) Date: Tue, 13 Sep 2022 22:30:09 +0500 From: Roman Mamedov To: "Kengo.M" Cc: linux-btrfs@vger.kernel.org Subject: Re: scrub results by email Message-ID: <20220913223009.11e1e549@nvm> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Tue, 13 Sep 2022 09:43:58 +0900 "Kengo.M" wrote: > btrfs scrub start -B option > do not background and print scrub statistics when finished > > btrfs scrub start -B /mnt/test.btrfs | mail -s "scrub result" foo@baa.com If you want to run a scheduled scrub from crontab, cron can be made to mail all output of all cron-issued commands to a designated E-Mail address. Add: MAILTO=admin@example.com on top of the crontab file. Once all crontab output is mailed instead of being discarded, it may require fine-tuning other scripts and commands you have scheduled there, by redirecting stdout to "> /dev/null" where reasonable (to only get notifications of errors). And perhaps set up filters in your mailing service or web interface, so that all scheduled logs from your machines group nicely into a designated folder. -- With respect, Roman