Results 1 to 9 of 9

Thread: Taking screenshots with scrot every minute.

  1. #1
    Join Date
    Jul 2010
    Beans
    4

    Taking screenshots with scrot every minute.

    Hello,

    I have an issue with crontab that I can't resolve even though I searched the web like crazy. I tried to create a new cron job for taking a screenshot automatically every minute with scrot using "crontab -e" like so...

    Code:
    * * * * * /usr/bin/scrot ~/screenshots/screen\%G-\%T.png > ~/log.txt
    when I run it in my shell it does work fine and it seems to run with cron also because the log.txt file is modified every minute, however when I run it through cron the screenshots don't appear in the screenshots directory and nowhere else either.

    Other jobs in the same crontab run very well. It doesn't seem to be a PATH issue because the paths are complete. I would love help on this thing because it is driving me nuts,

    Evren

  2. #2
    Join Date
    Jul 2009
    Location
    Dayton Ohio USA
    Beans
    1,070
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Taking screenshots with scrot every minute.

    This may be a similar issue as my rotating desktop background problem. Before the command you have to tell the application the display to use. Try this
    Code:
     *   *   *   *  env DISPLAY:0  scrot ~/screenshots/screen\%G\%T.png > ~/log.txt
    Basicly your script with
    Code:
    env DISPLAY:0
    before it.
    It's okay, I'm a limo driver

  3. #3
    Join Date
    Jul 2010
    Beans
    4

    Re: Taking screenshots with scrot every minute.

    Hello,
    Thanks for the idea. I tried this and variants too. It didn't work, unfortunately.

    Evren

  4. #4
    Join Date
    Jul 2009
    Location
    Dayton Ohio USA
    Beans
    1,070
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Taking screenshots with scrot every minute.

    I got it working as you wanted I think.Here is the screenshot.
    Attached Images Attached Images
    It's okay, I'm a limo driver

  5. #5
    Join Date
    Jul 2010
    Beans
    4

    Re: Taking screenshots with scrot every minute.

    Thank you so much !!! It works great ! I got the idea because they talked about snoopon.me on the net@night podcast with Amber MacArthur and Leo Laporte last week. Thanks again for the screenshot, it helped tons

    Good night !

    Evren

    PS: I created a short blog post to share this crontab line widely. You may find it at http://www.evrenkiefer.com/blog/2010...vals-in-linux/
    Last edited by evrenk; July 13th, 2010 at 08:15 AM. Reason: Adding link to blog post

  6. #6
    Join Date
    Dec 2010
    Beans
    2

    Re: Taking screenshots with scrot every minute.

    Hi, could you please add that line you figured out here on the forum -- the link to your blog doesn't seem to be working. Would be very helpful.

  7. #7
    Join Date
    Dec 2010
    Beans
    2

    Re: Taking screenshots with scrot every minute.

    The screenshot isn't very clear, but basically the line in crontab is

    Code:
    * * * * *            env DISPLAY=:0 /usr/bin/scrot output.jpeg

  8. #8
    Join Date
    Jul 2010
    Beans
    4

    Re: Taking screenshots with scrot every minute.

    Oops ! I broke my blog a while back and never got around to fixing it. Working like crazy on my master's 60 page thesis... Anyway, the line in my crontab is

    Code:
    * * * * * env DISPLAY=:0 /usr/bin/scrot ~/screenshots/screen\%F-\%T.png > /dev/null
    You have to install scrot and create a sceenshots directory in your home dir. Happy spying on yourself

  9. #9
    Join Date
    Apr 2009
    Beans
    241
    Distro
    Ubuntu

    Re: Taking screenshots with scrot every minute.

    You can also have a look at shoot.

    It supports multiple monitors, it doesn't take screenshots while you're idle and depends on import (which is probably already installed) rather than scrot.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •