my RapsberryPi should take a picture every 5 minutes (scheduled as cronjob) and send them to my FTP server.
I have put everything together in a sricpt
Code: Select all
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
But when I execute it as cronjob, the FTP-Upload seems to stop in the middle without any reason and does nothing.
The FTP-Log looks like this:
Code: Select all
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.
lG
Gawan