Skip to contentSkip to conversation

scrub results by email

DISCUSSION Kengo.M 4 participants 6 messages Sep 13, 2022 – Sep 14, 2022 Btrfs file system

lore
Share & tools
lore

Kengo.M

author
#0 lore raw

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" [email protected]

BRD

Kengo

#1 lore raw
Quoted 2 lines · Kengo.M

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.

author
#2 lore raw

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" [email protected]

kengo

Quoted 10 lines · Christoph Anton Mitterer
Quoted 2 lines · Kengo.M

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.

#3 lore raw
Quoted 4 lines · On Tue, 13 Sep 2022 09:43:58 +0900 "Kengo.M" <[email protected]> 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" [email protected]

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:

[email protected]

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.

Signature · 2 lines
With respect,
Roman
#4 lore raw
Quoted 4 lines · Roman Mamedov

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:

[email protected]

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.

author
#5 lore raw

Hi Roman,Phillip

Thank your information.

btrfs scrub start -B /mnt/test.btrfs | mail -s "scrub result" [email protected]

The above script was succeeded

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

Thanks

kengo