[X-Unix] Cron problem solved

Marley Graham mgraham at aquaflo.com
Fri Jun 24 15:05:05 PDT 2005


Management wants to randomly sample certain users' machines. These  
are people who have received repeated warnings about inappropriate  
use of the Internet and/or excessive game-playing on company time. So  
they wanted me to monitor their computers and take screenshots for  
use in "further discussions" with the employees.

As an aside, I used ARD for a while; it is really pretty simple to  
watch activity on a remote screen and take a snapshot. Then you can  
just scp the files from the computer & process them on your own  
system. But a semi-automated procedure relieves me from a lot of the  
tedium.

Marley Graham
Aqua-Flo Supply
==============

On Jun 24, 2005, at 1:01 PM, Dan DeRusha wrote:

> What do you use this for?
>
>
>
>
> On 6/24/05 2:08 PM, "Marley Graham" <mgraham at aquaflo.com> wrote:
>
>
>> Many thanks to Norman, Eugene, Eric, David, Robert & Brian who helped
>> me figure out my problems with Cron and date scripting, and with
>> achieving a much cleaner approach.
>>
>> My first problem was to get the date appended to a screencapture file
>> at the time of file creation by Cron. I created a script that worked
>> fine on the command line, but failed in Cron. The solution  was to
>> enclose the date command in quotes for Cron.
>>
>> The second problem was getting the script to run on a client computer
>> which I log onto with ssh. The solution to this problem was to use
>> root's crontab rather than the administrator's.
>>
>> Several people gave very helpful suggestions for cleaning up my
>> scripts and consolidating the functions. It was pointed out that the
>> command "date +%H:M:S" would do the same thing as my "exacttime"
>> script, and that it could be incorporated into my screencapture
>> script. (Or better yet, leave out the colons in the date format to
>> avoid future problems).
>>
>> So, here is what my screencapture script looks like:
>>          /usr/sbin/screencapture mg$(/bin/date "+%H%M%S")
>>
>> That is put into Cron using sudo crontab -u root -e:
>>          0,30 7-16 * * 1-6 /screenpictimed
>>
>> And gives an output like:
>>          mg103000
>>
>> At the end of the day, I use ps2pdf to convert the files to pdf, so I
>> can view them as a series of screen shots in iMovie. I created the
>> following script which I run to do the conversion and remove the
>> original files:
>>
>> #!/bin/sh        #psconvert
>>
>> for screen in $(ls mg*)
>> do
>>          ps2pdf $screen
>> done
>> rm mg*[1-9]
>> exit
>>
>> which leaves a series of files like:
>>          mg103000.pdf
>>
>> So, thanks again for all of the suggestions. I hope the results will
>> be useful to someone.
>>
>> Marley Graham
>> Aqua-Flo Supply
>> ==============
>> _______________________________________________
>> X-Unix mailing list
>> X-Unix at listserver.themacintoshguy.com
>> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
>>
>> Listmom is trying to clean out his closets! Vintage Mac and random  
>> stuff:
>>          http://search.ebay.com/_W0QQsassZmacguy1984
>>
>
> Dan DeRusha
> IT Manager
> Schawk
>
> 847 287-1337 mobile
> 847 296-6000 main
> 847 296-9466 fax
>
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
>
> Listmom is trying to clean out his closets! Vintage Mac and random  
> stuff:
>          http://search.ebay.com/_W0QQsassZmacguy1984
>



More information about the X-Unix mailing list