#!/bin/bash # set working dir to script's base dir cd "$( dirname "${BASH_SOURCE[0]}" )" slide_path="./slides/$(date +"%Y-%m-%d")/$(date +"%H.%M.%S").jpg" mkdir -p "$(dirname "$slide_path")" raspistill -vf -hf -o "$slide_path"