Skip to content

Short script to make screenshots and save them in predefined directory.

Notifications You must be signed in to change notification settings

java-academy/screenshots-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Screenshots script

Short script to make screenshots and save them in predefined directory.

Specification

  1. Write a bash script.

  2. The script should take a screenshot.

  3. The screenshot’s name should contain date and time of taking.

  4. All the screenshots should be saved in a predefined directory.

  5. The directory’s name should contain date without time when all screenshots inside was taken. Basically for each day new directory should be created with appropriate date.

Cron

About cron.

To add new task to cron use command crontab -e and edit the file.

Caution
In cron days are count from 0 to 6 where 0 is Sunday and 6 is Saturday.

To fulfil specification it should look similar to code below:

*/15 * * * * export DISPLAY=:0 && $HOME/DIR_OF_YOUR_SCRIPT/screenshot.sh

Where DIR_OF_YOUR_SCRIPT is actual directory of your script.

To test your cron setup you can use cron guru.

Warning
Remember to give your script the access permissions to file system objects (files and directories). For example use command chmod +x YOUR_SCRIP.sh where YOUR_SCRIP is actual name of script.

About

Short script to make screenshots and save them in predefined directory.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages