Thursday 13 June 2013

And in other news..

updated the script that takes the images, so instead of having 10 individual scripts, that are called from cronjob, I know have a single script that takes an image and names it based on the actual minute.

much neater, as only needs 1 entry in cronjob, and is just easier to maintain..

Contained in links on left, but also here :)

 #!/bin/bash
# script to take picture from webcam on /dev/video0
# then upload to gliding centre webserver
# get the single digit of time, ie 0-9 for file extension
day=`date "+%a"`
DMY=`date "+%x"`
now=`date "+%R"`
taken=$day"_"$DMY"_"$now
gettime=`date "+%M"`
lastminute=`echo $gettime | sed -e 's/\(^.*\)\(.$\)/\2/' `
filename="picam01_"$lastminute".jpg"
# take photo
fswebcam -d /dev/video0 -i 0 --title "HusBos West" -r 640x480 $filename
echo picture taken $taken
# upload to website
ncftpput -u user -p password your.ftpserver.co.uk /picam/1/ $filename
echo picture $filename uploaded $taken

No comments:

Post a Comment