scrub results by email
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
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.
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.
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 finishedbtrfs 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:
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
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:
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.
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