Sonntag, 24. August 2014

shell script automatic captures limited to specified daytime

if the shell script, which controls the automatic captures, shall be executed from 5:00h to 21:59h, do like this:
(daytime greater or equal 5:00h lower or equal 21:00h)

#!/bin/bash
host='YOURHOSTNAME'
USER='YOURUSERNAME'
PASS='YOURPASSWORD'
hour=`date +"%H"`
while [ $hour -ge 5 ] && [ $hour -le 21 ]
do
/usr/bin/gphoto2 --capture-image-and-download --filename
ftp -n -v $host <<EOT
ascii
user $USER $PASS
prompt
cd /array1/EigeneD/EigeneCaptures/
put *.JPG
bye
EOT
cp *.JPG /var/www/minigal/photos/last.JPG
rm *.JPG
echo warte 20 sek
sleep 20
done

Keine Kommentare:

Kommentar veröffentlichen