HDDTemp is a small Linux utility (with daemon), that gives information about the hard drive temperature via S.M.A.R.T. (for drives supporting this feature).
In this article we are going to create a txt file and in it we are going to store the HDD temperature for every hour.
How to install HDDTemp?
# Install in Ubuntu sudo apt-get install hddtemp # Install in Open Suse sudo zypper install hddtemp # Install in CentOS / RHEL / SL / Oracle Linux sudo yum install hddtemp # Install in Arch Linux sudo pacman -S hddtemp # Install in Fedora sudo dnf install hddtemp # Install in FreeBSD pkg install hddtempCode language: Bash (bash)
How to configure the crontab?
First type in the terminal crontab -e
# Start crontab crontab -eCode language: PHP (php)
Now in the crontab insert the following code
# Add hdd temp every hour * * * * * echo `date`,`/usr/sbin/hddtemp /dev/sda` >> /root/hddtemp.txtCode language: PHP (php)
We have to create a file hddtemp.txt in any folder that we want in this case it’s the root folder and make it writable
# Touch and make executable file touch /root/hddtemp.txt chmod 777 /root/hddtemp.txtCode language: PHP (php)
You can check the temp via cat ot tail or vi or nano 🙂
# Check temp pico /root/hddtemp.txt cat /root/hddtemp.txt tail /root/hddtemp.txtCode language: PHP (php)
In this article we have created a super simple cron job and we have exported it into a file which will check every hour our HDD temperature.. If you know other good apps, please tell us in the comments bellow.