Who can help me with a script? The following script , I saved as a .py file and added my scripts folder with the correct permissions. But if I want to run scripts from terminal ( for testing ), I just get errors (syntax ) . I used the Text Editor (plain text) , TextWrangler . Nothing helps .
Code: Select all
#!/bin/sh
#Used to generate filename
today=`/bin/date '+%d-%m-%Y__%H-%M-%S'`;
#Get Snapshot from camera
wget "http://admin:[email protected]:80/image/jpeg.cgi" -O /home/pi/domoticz/tmp/zolder-$today.jpeg
#Send telegram with snapshot
curl -X POST "https://api.telegram.org/botXXXXXXXXXXXXXXXXXXXX/sendPhoto" -F chat_id=-XXXXXXXXXXXXXX -F photo="@/home/pi/domoticz/tmp/zolder-$today.jpeg"
#Delete previous taken snapshots older than 7 days
find /home/pi/domoticz/tmp/ -name '*.jpeg' -mtime +7 -delete