Skip to content

Instantly share code, notes, and snippets.

@litzinger
Last active November 17, 2023 07:30
Show Gist options
  • Save litzinger/7320462 to your computer and use it in GitHub Desktop.
Save litzinger/7320462 to your computer and use it in GitHub Desktop.
Take screenshot every 5 minutes
First, create a couple new folders:
cd ~/
mkdir Scripts
mkdir Screenshots
cd Screenshots
mkdir cron
cd ~/Scripts
vim screencapture.sh
Paste the following into the new file:
#!/bin/bash
TIMESTAMP=`date +%Y%m%d%H%M%s`
screencapture -x ~/Screenshots/cron/$TIMESTAMP.jpg
crontab -e
Create a new line by pasting the following:
*/05 * * * * ~/Scripts/screencapture.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment