Skip to content

Instantly share code, notes, and snippets.

@camme
Last active May 29, 2019 06:47
Show Gist options
  • Save camme/c545fb41e1087aea2ed6d70f46e913ca to your computer and use it in GitHub Desktop.
Save camme/c545fb41e1087aea2ed6d70f46e913ca to your computer and use it in GitHub Desktop.
Take screenshots on your mac from all your monitors and save them datewise. Use it together with cron.
#!/bin/bash
set -e
EXEC_PATH=/usr/sbin/screencapture
FOLDER=~/Pictures/journal/$(date +"%Y")-w$(date +%V)/$(date +'%Y-%m-%d')
mkdir -p $FOLDER
FILES=""
for screen in screen1 screen2
do
FILES="$FILES $FOLDER/screenshot-$(date +'%H-%M')-$screen.jpg"
done
$EXEC_PATH -x $FILES
@camme
Copy link
Author

camme commented May 29, 2019

How to trigger screenshots every 30 minutes

Create the file and

chmod +x take-screenshots.sh

run

crontab -e

and add the following line

*/30 * * * * $HOME/Dropbox/scripts/take-screenshots.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment