Site Tools


linux:raspberry:wde:scripts:reader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:raspberry:wde:scripts:reader [2015/07/27 09:29] lunetikklinux:raspberry:wde:scripts:reader [2019/12/10 14:43] (current) – [Script 3 - Killer] lunetikk
Line 5: Line 5:
 ==== Script 1 - Starter ==== ==== Script 1 - Starter ====
  
-This will execute socat with daily modified parameters. The logfile parameter will have the date of "today". It starts at 12:02 am everyday.+This will execute socat with daily modified parameters. The logfile parameter will have the date of "today". It starts at 12:01 am everyday.
  
 <code bash wde.sh> <code bash wde.sh>
Line 16: Line 16:
 echo "" > /dev/null echo "" > /dev/null
 else else
-echo "Date;Time;Column1;Column2;Column3;Column4;Column5;Column6;Column7;Column8;Column9;Column10;Column11;Column12;Column13;Column14;Column15;Column16;Column17;Column18;Column19;Column20;Column21;Column22;Column23;Column24;Column25" > /media/wetterlog/$DATE$FILETYPE+echo "Date;Time;Column1;Column2;Column3;Column4;Column5;Column6;Column7;Column8;Column9;Column10;Column11;Column12;Column13;Column14;Column15;Column16;Column17;Column18;Column19;Column20;Column21;Column22;Column23;Column24;Column25" > /media/weatherlog/$DATE$FILETYPE
 fi fi
  
Line 33: Line 33:
 FILETYPE=.log FILETYPE=.log
  
-FILE=/media/wetterlog/$DATE$FILETYPE+FILE=/media/weatherlog/$DATE$FILETYPE
  
 SOCAT=/usr/bin/socat SOCAT=/usr/bin/socat
Line 39: Line 39:
 BAUD=\,b9600 BAUD=\,b9600
 CMD="$SOCAT $DEV$BAUD STDOUT" CMD="$SOCAT $DEV$BAUD STDOUT"
- 
  
 while read -r line while read -r line
 do do
-    echo "$(date +'%d.%m.%Y;%H:%M:%S;')$line" >> $FILE+    echo "$(date +'%d.%m.%Y;%H:%M:%S;')$line">> $FILE
 done < <( $CMD ) done < <( $CMD )
 </code> </code>
Line 49: Line 48:
 ==== Script 3 - Killer ==== ==== Script 3 - Killer ====
  
-This script is killing socat everyday at 11:58 pm. Remember, it will start again at 12:02 am with a new date.+This script is killing socat everyday at 11:59 pm. Remember, it will start again at 12:01 am with a new date.
  
 <code bash wdekill.sh> <code bash wdekill.sh>
Line 60: Line 59:
 ==== Output ==== ==== Output ====
  
-There will be a new logfile with another date everyday. +There will be a new logfile with another date everyday. 
 + 
 +Examplefile 06_05_2015.log:
  
-Examplefile 05_06_2015.log: 
 <code> <code>
 06.05.2015;16:00:26;$1;1;;34,8;71,1;;;33,1;;;;33;;;;39;;;;;;;;;0 06.05.2015;16:00:26;$1;1;;34,8;71,1;;;33,1;;;;33;;;;39;;;;;;;;;0
Line 74: Line 74:
  
 \\ \\
-\\ +~~DISCUSSION:closed~~ 
-~~DISCUSSION~~+ 
linux/raspberry/wde/scripts/reader.1437982142.txt.gz · Last modified: 2017/03/01 12:50 (external edit)