Raspberrypi_temp_logger/log_temp

10 lines
494 B
Plaintext
Raw Permalink Normal View History

2024-02-27 00:16:47 +00:00
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
cpu_t=$((cpu/1000))
data=$(date +"%d %I:%M %p")
echo "CPU Temp: $cpu_t c $data" >> /nas/share/brickman/logs/temp/cpu_temp.log
gpu=$(vcgencmd measure_temp | cut -c 6-7 -)
echo "GPU Temp: $gpu c $data" >> /nas/share/brickman/logs/temp/gpu_temp.log
ssd=`sudo smartctl -d sat,12 --all /dev/sda | grep Temperature_Celsius | cut -c 87-89 - `
echo "SSD Temp: $ssd c $data" >> /nas/share/brickman/logs/temp/ssd_temp.log