Created
May 2, 2017 19:30
-
-
Save omiq/617d7cbc7dd5ce19b948bdcdbe266bbe to your computer and use it in GitHub Desktop.
Raspberry Pi Webcam to Dropbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set the date variable to the current date and time | |
DATE=$(date +"%Y-%m-%d_%H%M") | |
# Take the picture and save with the date as filename | |
raspistill --rotation 270 -w 1024 -h 768 -o /home/pi/pics/$DATE.jpg | |
# Add the date caption | |
convert /home/pi/pics/$DATE.jpg -pointsize 32 -fill red -annotate +700+700 $DATE /home/pi/pics/$DATE.jpg | |
# Upload the full size image to dropbox | |
/home/pi/Dropbox-Uploader/dropbox_uploader.sh upload /home/pi/pics/$DATE.jpg $DATE.jpg | |
# Convert to a smaller version for web display | |
convert /home/pi/pics/$DATE.jpg -resize 600 /home/pi/pics/fresh.jpg | |
# Delete from local | |
rm /home/pi/pics/$DATE.jpg -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment