Skip to content

Instantly share code, notes, and snippets.

@koji
Last active February 16, 2019 20:28
Show Gist options
  • Save koji/8102723a3bf1ef99e3a05bfd0ee90228 to your computer and use it in GitHub Desktop.
Save koji/8102723a3bf1ef99e3a05bfd0ee90228 to your computer and use it in GitHub Desktop.
cron

create shellscript

$ mkdir TakePhotos
$ cd TakePhotos
$ vim runCamera.sh

install fswebcam

$ sudo apt-get install fswebcam

runCamera.sh

#!/bin/bash

DATE=$(date +"%Y-%m-%d_%H%M")

#raspistill -vf -hf -o $(pwd)/$DATE.jpg
fswebcam -r 640x480 -F 100 $(pwd)/$DATE.jpg

set cron task (call runCamera.sh)

echo '* 8 * * * your_shellscript_path' > cron.conf
crontab cron.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment