Skip to content

Instantly share code, notes, and snippets.

@omiq
Created May 2, 2017 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omiq/617d7cbc7dd5ce19b948bdcdbe266bbe to your computer and use it in GitHub Desktop.
Save omiq/617d7cbc7dd5ce19b948bdcdbe266bbe to your computer and use it in GitHub Desktop.
Raspberry Pi Webcam to Dropbox
#!/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