Created
August 23, 2016 17:30
-
-
Save wopfel/9e38db3e059f5d6b5b2d01ee8bf3ab15 to your computer and use it in GitHub Desktop.
Save a webcam picture every x seconds (suitable for a timelapse). Created on a Raspberry Pi 3 running Arch Linux.
This file contains hidden or 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 | |
# Exit script if /mnt is not mounted somewhere | |
# Prevents filling the root filesystem (/) | |
if ! mountpoint /mnt ; then | |
>&2 echo "Error: No mountpoint." | |
exit 1 | |
fi | |
# Endless loop | |
while true; do | |
name=`date +'%Y-%m-%d_%H%M%S'` | |
fswebcam -r "1280x720" -v -F 1 -S 35 --no-banner - > /mnt/$name.jpg | |
cp /mnt/$name.jpg /mnt/aktuell.jpg | |
echo Sleeping... | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment