take photo and screenshot every 5 minutes
#!/bin/bash
# 0/5 * * * * $HOME/Code/autophoto.sh >> /dev/null
if [ ! -d "$HOME/Pictures/AutoPhotos/screen/$(date +%Y%m%d)/" ]; then
mkdir -p "$HOME/Pictures/AutoPhotos/screen/$(date +%Y%m%d)/"
fi
if [ ! -d "$HOME/Pictures/AutoPhotos/picz/$(date +%Y%m%d)/" ]; then
mkdir -p "$HOME/Pictures/AutoPhotos/picz/$(date +%Y%m%d)/"
fi
/usr/sbin/screencapture -x -t jpg ~/Pictures/AutoPhotos/screen/$(date +%Y%m%d)/$(date +%H%M)s.jpg
/usr/bin/imagesnap -w 1.5 -q ~/Pictures/AutoPhotos/picz/$(date +%Y%m%d)/$(date +%H%M)p.jpg