Checking the disk for errors and bad sectors

This script helps to notify me by e-mail about the condition of the disk. Remember to indicate the disk accordingly – in this case it is “/dev/sda” and change the e-mail address from “soban@soban.pl” to your own. Save the script in “/root/checkbadsector.sh“:

You can also download it from https://soban.pl/bash/checkbadsector.sh:

Remember to grant permission to perform it:

On my server I added it once a month so that it would be performed periodically in the crontab:

You should receive an email similar to the one below:

Good luck and I wish you no errors!