Disk check script

It has been a while since my last update to this site. Now the time has come for another post. :-)

A few days ago I visited UDS-r in Copenhagen Denmark. I met a lot of nice people and got the chance to hear about the plans for the next release of Ubuntu.

The trip to UDS was fantastic but on my way home i got mail from my server telling me that one disk had failed. Bummer! That ruined the day for me. Lost a few files because i had not taken a backup for a couple of weeks.

Since then I have invested in a new NAS from Synology that has served me quite well since then. But i still have a server that has a few hard drives. So I decided to go ahead and write a small script that is executed once a day via cron. That script uses smartmontools to check the S.M.A.R.T status of the disk in the server. Hopefully this will give me an early warning.

The script uses and array in bash and some other fun things. If you have questions feel free to comment/ask.

2 thoughts on “Disk check script

  1. Pingback: Bash: Script to monitor hard disk health and send an e-mail on error. | Chris Sidiropoulos

Leave a Reply to Danial Gordi Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.