3 cd /home/dpavlin/eg5120
5 mosquitto_sub -h localhost -t eg5120 | while read json ; do
6 date=$( date +%Y-%m-%dT%H:%M:%S )
8 echo $json | tee data/$date.json | tee /dev/shm/last-eg5120.json
9 psql --quiet -c "copy eg5120 (json) from '/dev/shm/last-eg5120.json'" eg5120