Capture and organize screenshot automatically once every 6 minutes


/ Published in: Bash
Save to your folder(s)

These are two separate code snippets. One is for a crontab, the other to be run by cron.

Together they create a new folder every day and fills it with 240 jpeg images (10 per hour) of whatever it is that you're doing.

The next step for me is to figure out how to automate the process of turning these into frames in a slideshow/video automatically from a daily script...

...becauseitwouldbeawesome.


Copy this code and paste it in your HTML
  1. #! /bin/bash
  2. ################################
  3. ## name this: daily_sshots.sh ##
  4. ################################
  5. year=`date +%Y`
  6. month=`date +%m`
  7. day=`date +%d`
  8. now=`date +%Y%m%d%H%M%S`
  9. uname=//your user name
  10.  
  11. mkdir -p /home/$uname/Pictures/daily_screenshots/$year/$month/$day
  12.  
  13. DISPLAY=:0 scrot /home/$uname/Pictures/daily_screenshots/$year/$month/$day/sshot$now.jpg
  14.  
  15.  
  16. #######################################
  17. ## Then in a crontab via: crontab -e ##
  18. #######################################
  19.  
  20. # m h dom mon dow command
  21. */6 * * * * sh /path/to/above/code/in/file/daily_sshots.sh

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.