Linux Tip: (hdd temp in conky)

I have had a problem for a while now. I wanted to display my hard drive temp's in conky.

To do this I used this command.

sudo hddtemp /dev/sda

This worked great except for the fact that the conky instance I was using has a .7 second update interval. This made my hard drive light blink constantly and because of where my case was it was quite annoying when watching a movie or something. So to solve this I created a script that I could run in cron that would write the info I needed out to a txt file in my temp directory.
This was the command I used.

sudo hddtemp /dev/sda >> /tmp/hddtemp

I also added hddtemp to my sudoer so it would not require a password.

The problem I had was the script would work fine if ran manually but when I let cron run it I got no output to the text file.

Well I finally tonight figured out why. You have to specify the location of the command in cron I guess. so this is what I did.

I ran this command

whereis hddtemp

The output I got was


So I modified my cron script like this

/usr/sbin/hddtemp /dev/sda >> /tmp/hddtemp

Now it works perfect. Every 10 minutes cron updates the text file and I can now see my hard drive temps on my desktop in conky. If you look in the picture my hard drive temps are displayed to the right at the bottom of "system health".

Hope this helps everyone.


Add comment

Comments do not require an account. Anyone is welcome and encouraged to leave a comment.

However, If you are a spammer all comments require admin approval so your wasting your time and mine.
No one will ever see it. Please stop posting spam.


Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.