Skip to content

Instantly share code, notes, and snippets.

@mc3k
Created April 26, 2016 16:51
Show Gist options
  • Select an option

  • Save mc3k/d54e79abca5d3ff4e29fa661ad869531 to your computer and use it in GitHub Desktop.

Select an option

Save mc3k/d54e79abca5d3ff4e29fa661ad869531 to your computer and use it in GitHub Desktop.
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
cd "$SCRIPTPATH"
python3 temp.py
echo "
set terminal png size 900, 300
set xdata time
set xrange [ time(0) - 86400 : time(0) ] # 86400 sec = 1 day
set timefmt '%Y-%m-%d,%H:%M:%S'
set format x '%H:%M'
set output 'tempplot.png'
plot 'temp.dat' using 1:2 with lines title 'CPU Temp deg C'" | gnuplot
cp tempplot.png /var/www/web/data/sys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment