Advertisement
Guest User

temperature monitor script

a guest
Nov 21st, 2014
1,051
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.67 KB | None | 0 0
  1. ## Script to be run every 15 minutes and collect temperature data on my CPU
  2. ## Created by Ben Heffron on 21 November 2014
  3. ##Used to measure temperature of 'server' in my garage during the winter
  4. #!/bin/bash
  5. DATE=$(date +"%D %H:%M:%S")
  6. CPUTEMP=$(sensors -f | grep 'CPU Temperature' | cut -c22-25)
  7. #get temperature data from NOAA
  8. wget -O /tmp/KDAA.xml http://w1.weather.gov/xml/current_obs/KDAA.xml
  9. CURTEMP=$(cat /tmp/KDAA.xml | grep temp_f | cut -c10-13)
  10. #put it into happy CSV format
  11. TEMP=$(echo $DATE,$CPUTEMP,$CURTEMP )
  12. #why wouldn't it work without this touching? is it horny?
  13. touch /media/Media/Network/Temperatures.csv
  14. echo $TEMP >> /media/Media/Network/Temperatures.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement