Skip to content

Instantly share code, notes, and snippets.

@luanlmd
Created November 25, 2013 23:33
Show Gist options
  • Save luanlmd/7650827 to your computer and use it in GitHub Desktop.
Save luanlmd/7650827 to your computer and use it in GitHub Desktop.
#!/bin/bash
TIMESTAMP=$(date +"%Y-%m-%d_%T")
FILE="/home/pi/timelapse/$TIMESTAMP.jpg"
EX="beach"
ISO="100"
HOUR=$(date +"%k")
if [ $HOUR -lt 6 ] || [ $HOUR -gt 18 ];
then
EX="night"
ISO="400"
fi
echo "Taking photo $FILE"
raspistill -o $FILE -q 100 -ISO $ISO -awb horizon -ex $EX -rot 180
echo "Syncing"
/usr/bin/rsync --progress -avhz --update /home/pi/timelapse/ user@server.com:/home/user --ignore-errors
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment