public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* scrub results by email
@ 2022-09-13  0:00 Kengo.M
  2022-09-13  0:10 ` Christoph Anton Mitterer
  0 siblings, 1 reply; 6+ messages in thread
From: Kengo.M @ 2022-09-13  0:00 UTC (permalink / raw)
  To: linux-btrfs

Hi folks

I would like to send results of btrfs scrub by email.
How are you all doing?

If finish "btrfs scrub start" then continue execute "btrfs scrub status"

Like this

btrfs scrub start /mnt/test.btrfs
btrfs scrub status /mnt/test.btrfs | mail -s "scrub results" foo@baa.com

BRD

Kengo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: scrub results by email
  2022-09-13  0:00 scrub results by email Kengo.M
@ 2022-09-13  0:10 ` Christoph Anton Mitterer
  2022-09-13  0:43   ` Kengo.M
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Anton Mitterer @ 2022-09-13  0:10 UTC (permalink / raw)
  To: Kengo.M, linux-btrfs

On Tue, 2022-09-13 at 09:00 +0900, Kengo.M wrote:
> I would like to send results of btrfs scrub by email.
> How are you all doing?

That's not really a btrfs specific question... but try using btrfs-
scrub’s -B option.


Cheers,
Chris.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: scrub results by email
  2022-09-13  0:10 ` Christoph Anton Mitterer
@ 2022-09-13  0:43   ` Kengo.M
  2022-09-13 17:30     ` Roman Mamedov
  0 siblings, 1 reply; 6+ messages in thread
From: Kengo.M @ 2022-09-13  0:43 UTC (permalink / raw)
  To: linux-btrfs

Hi Chris

Thanks

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

kengo
At 02:10 +0200 2022.09.13, Christoph Anton Mitterer wrote:
>On Tue, 2022-09-13 at 09:00 +0900, Kengo.M wrote:
>  > I would like to send results of btrfs scrub by email.
>>  How are you all doing?
>
>That's not really a btrfs specific question... but try using btrfs-
>scrub’s -B option.
>
>
>Cheers,
>Chris.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: scrub results by email
  2022-09-13  0:43   ` Kengo.M
@ 2022-09-13 17:30     ` Roman Mamedov
  2022-09-13 19:39       ` Phillip Susi
  0 siblings, 1 reply; 6+ messages in thread
From: Roman Mamedov @ 2022-09-13 17:30 UTC (permalink / raw)
  To: Kengo.M; +Cc: linux-btrfs

On Tue, 13 Sep 2022 09:43:58 +0900
"Kengo.M" <kengo@kyoto-arc.or.jp> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: scrub results by email
  2022-09-13 17:30     ` Roman Mamedov
@ 2022-09-13 19:39       ` Phillip Susi
  2022-09-14  3:00         ` Kengo.M
  0 siblings, 1 reply; 6+ messages in thread
From: Phillip Susi @ 2022-09-13 19:39 UTC (permalink / raw)
  To: Roman Mamedov; +Cc: Kengo.M, linux-btrfs


Roman Mamedov <rm@romanrm.net> writes:

> 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

And it defaults to sending it to $USER@localhost, so you only need to
bother with MAILTO= if you want it to go to a different mailbox.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: scrub results by email
  2022-09-13 19:39       ` Phillip Susi
@ 2022-09-14  3:00         ` Kengo.M
  0 siblings, 0 replies; 6+ messages in thread
From: Kengo.M @ 2022-09-14  3:00 UTC (permalink / raw)
  To: linux-btrfs

Hi Roman,Phillip

Thank your information.

btrfs scrub start -B /mnt/test.btrfs | mail -s "scrub result" foo@baa.com

The above script was succeeded

And I would like to use that your suggestion.
Also,I use debian(bullseye) with msmtp.

Thanks

kengo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-14  3:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13  0:00 scrub results by email Kengo.M
2022-09-13  0:10 ` Christoph Anton Mitterer
2022-09-13  0:43   ` Kengo.M
2022-09-13 17:30     ` Roman Mamedov
2022-09-13 19:39       ` Phillip Susi
2022-09-14  3:00         ` Kengo.M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox