Skip to content

Instantly share code, notes, and snippets.

@dmgig
Created July 13, 2016 21:30
Show Gist options
  • Save dmgig/1b1385500452775a0b09d3925f59366d to your computer and use it in GitHub Desktop.
Save dmgig/1b1385500452775a0b09d3925f59366d to your computer and use it in GitHub Desktop.
Take screenshot, remove all older than 2 weeks (mac, requires cron job)
#!/bin/bah
/usr/sbin/screencapture -t jpg -x ~/Desktop/screenshots/$(date +%Y\-%m\-%d\_%H.%M.%S).jpg;
find ~/Desktop/screenshots/ -type f -name '*.jpg' -mtime +14 -exec rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment