Hallo,
ich habe einen RaspPi der im 5-Minuten-Takt (per cronjob) Fotos machen und diese per FTP auf meinen Webserver schieben soll.
Das erste Foto nach dem Hochfahren klappt, danach bricht die FTP-Verbindung einfach jedesmal ohne erkennbaren Grund ab.
Wenn ich das Skript händisch ausführe klappts jedesmal ohne Probleme. Nur über den Cronjob gehts nicht.
Das Skript das ich dazu gebastelt habe sieht so aus:
Code
sudo ntpdate de.pool.ntp.org
DATE=$(date +"%Y%m%d_%H%M")
/usr/bin/raspistill -st -n -t 2000 -o /home/pi/camera/$DATE.jpg -w 1024 -h 768 -q 100
HOST=ftp.meinserver05567.com
USER=dingdong
PASS=dingdong123
/usr/bin/ftp -pinv $HOST <<EOF
user $USER $PASS
cd /webcam/images1/
put $DATE.jpg
bye
EOF
Display More
Im FTP-Log nach einem Cronjob-Anlauf siehts dann so aus:
Code
Connected to ftp.meinserver05567.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 8 of 400 allowed.
220-Local time is now 12:05. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
331 User dingdong OK. Password required
230-Your bandwidth usage is restricted
230 OK. Current directory is /
/etc/rc.localRemote system type is UNIX.
Using binary mode to transfer files.
250 OK. Current directory is /webcam/images1
local: 20161211_1205.jpg remote: 20161211_1205.jpg
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
Display More
Hat jemand eine Idee für mich ?
lG
Gawan