Guten Morgen,
ich habe an meinen Raspberry eine Webcam angehängt und lasse ihn nach diesem Tutorial alle 2 Minuten ein Bild aufnehmen und auf meinen Server hochladen: http://derkev.in/262/raspberry-…p-webcamserver/
Das funktioniert einwandfrei, sowohl in der Shell als auch per cron.
Dann habe ich ein weiteres Script erstellt nach dieser Vorlage: http://pastebin.com/8se6typR
Konkret sieht mein Script so aus:
Code
filename=$(date +"%d.%m.%Y-%H:%M").jpg
#kfilename=$(date +"%d.%m.%Y-%H:%M")-150x150.jpg
echo -e "\033[44;1;33m Variable setzen \033[0m"
echo "Dateiname = "$filename
#echo "Dateiname = "$kfilename
echo ""
sleep 1
echo -e "\033[44;1;33m Bild aufnehmen \033[0m"
sleep 1
fswebcam -c webcam.cfg
echo ""
echo ""
echo -e "\033[44;1;33m Bild umbenennen in "$filename "\033[0m"
mv live.jpg $filename
echo -e "\e[00;36mdone \e[00m"
echo ""
#echo -e "\033[44;1;33m Thumbnail erstellen und croppen \033[0m"
#econvert -i $filename --scale 0.276 --crop 0,0,150,150 -o $kfilename
#echo -e "\e[00;36mdone \e[00m"
#echo ""
echo -e "\033[44;1;33m Bild Upload \033[0m"
ncftpput -f ftp.cfg /hour $filename
echo ""
#echo -e "\033[44;1;33m Thumbnail Upload \033[0m"
#ncftpput -f ftp.cfg /hour $kfilename
#echo ""
echo -e "\033[44;1;33m Loeschen von " $filename "\033[0m"
rm $filename
echo -e "\e[00;36mdone \e[00m"
echo ""
#echo -e "\033[44;1;33m Loeschen von " $kfilename "\033[0m"
#rm $kfilename
#echo -e "\e[00;36mdone \e[00m"
#echo ""
Alles anzeigen
Das Erstellen der Thumbs habe ich auskommentiert - auch das funktioniert auf der Shell einwandfrei.
Mein Problem: cron führt dieses Script leider nicht aus, meine crontab sieht so aus:
Code
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
*/2 * * * * /home/pi/webcamrun.sh > /dev/null 2>&1
0 */1 * * * /home/pi/webcam-history.sh > /dev/null 2>&1
Alles anzeigen
Die SHELL und PATH Angaben habe ich im Internet gefunden, aber das scheint auch noch nicht zu reichen. Kann mir jemand helfen?