local tempfilename = "/home/pi/domoticz/scripts/tmp/rain.tmp"
change that to a tempfs folder.
Within cron you can trigger a script at restart:
Code: Select all
sudo crontab -e
Code: Select all
@reboot /home/pi/atstartup.sh
Code: Select all
#!/bin/bash
sudo chmod 777 /var/log
sudo mkdir /var/log/nginx
sudo chmod 777 /var/log/nginx
sudo service nginx start
echo 0 | sudo tee /sys/class/leds/led0/brightness
echo 0 | sudo tee /sys/class/leds/led1/brightness
sleep 2
sudo cp /run/pikrellcam/mjpeg.jpg /temp/snapshot.jpg
sudo chmod 666 /temp/snapshot.jpg
curl -s --data-urlencode "text=PiCam1 Voordeur started" --data "silent=true" http://127.0.0.1/telegram.php