0 10 * * * import -window root ~/screeshots/`date`.png
^^^ just put that in your crontab
or iif you prefer you can put the command into a script and cron that...
those are backtics around date
I want to create a cronjob that every morning at a certain time, will take a screenshot of my desktop and whatever I happen to be doing at that point in time.
I want it to name the screenshot in the following format:
date_screenshot.png, so the screenshot for today would be:
20041118_screenshot.png (yearmonthday)
and save it to the ~/screenshots folder.
two things.....
a. I think I need a script to actually handle the naming of the screenshot
and
b. I don't know where to begin.
Actually, I think I have an idea.....
The first person that provides the script and the cron to successfully do this will receive his or her choice of a Penguin Power Button or Magnet (I know its not much, but its all I can afford!) from the LF Store.
0 10 * * * import -window root ~/screeshots/`date`.png
^^^ just put that in your crontab
or iif you prefer you can put the command into a script and cron that...
those are backtics around date
Doesn't work.
If I run:
import -window root ~/screenshots/`date`.png
at the cli, it thinks for a minute, but it doesn't do anything.
sorry forgot the date format is wrong
you need:
import -window root ~/screenshot/`date +"%F"`.png
Code:maccorin@debian:~$ import -window root ~/screenshot/`date +"%F"`.png maccorin@debian:~$ ls screenshot/ 2004-11-18.png maccorin@debian:~$
in case your wondering, the reason the first one didn't work is because it had a space in the output of `date`, so there was no recognizable image extension for import to decide what kind of file to make, in that case it just silently bails... which should probably be fixed.
Well, I guess you win the, um, button.
BUt thats ok. If solo keeps buy stuff from amazon, we'll have another gift certificate to give away.... which means another competition.
Dang! I gotta start checking the forums after I get home from work. I missed an easy one.
This is really great way to support the site too. Good idea Mark.
Hey neat trick. That one is going on my list!
And don't forget the swag I just bought (WPL ball cap, and a TM big mug). Very nice stuff, BTW :w00t: :mrgreen: . I've got one of the LNX stickers on the bumper of my truck; though I haven't had anyone ask about it yet (so are you from Luxemberg, or what? :mrgreen: ) . Guess I'll take some pictures this weekend and post them.Originally Posted by mcangeli";p="3713
Oh, and that is a slick little cron trick there mac.
Steve
Bookmarks