[Casper] Flushing User Caches

Thomas Larkin tlarki at kckps.org
Wed Jan 21 13:53:41 PST 2009


Forgot to mention, this is written as a log in hook, so the it will pull
the current user's home directory.  If you run it otherwise it won't
work as it will look for root's home since it will be running most
likely as root.  
 

___________________________
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry:  913-449-7589
office:  913-627-0351





>>> Miles Leacy <miles.leacy at themacadmin.com> 01/21/09 3:30 PM >>> 
I see two problems with your script...

1. I don't believe "~" will work in your script since it's run by root.
 I
use the Casper variables to indicate "the home folder of the account
logged
in (or being logged in).  See my commands below.
2. If your clients are Leopard clients, you won't find anything at
~/Library/Caches/Safari/.  See below for the locations to be concerned
with.

If you want to emulate the "Reset Safari" menu item put this in your
script
instead:

m -Rf /Users/$3/Library/Cookies/*
m -Rf /Users/$3/Library/Safari/*
rm -Rf /Users/$3/Library/Caches/Metadata/Safari/*
rm -f /Users/$3/Library/Preferences/com.apple.Safari.plist
rm -f /Users/$3/Library/Preferences/com.apple.Safari.RSS.plist

You will, of course, need to reset any preferences you did want in
there
such as a default home page.  You can do this with "defaults write" or
"PlistBuddy" at the end of your script.

----------
Miles A. Leacy IV

 Certified System Administrator 10.4
 Certified Technical Coordinator 10.5
 Certified Trainer
Certified Casper Administrator
----------
voice: 1-347-277-7321
miles.leacy at themacadmin.com
www.themacadmin.com




On Wed, Jan 21, 2009 at 3:58 PM, Gene Anderson <ganderson at phrd.ab.ca>
wrote:

> "Thomas Larkin" <tlarki at kckps.org> writes:
> >What you can do is have a policy set for log in via JSS web front
end and
> have it execute the script.  Can you post your script?
>
> rm -Rf ~/Library/Caches/Safari/*
>
> > I assume removing the temp and cache files the application will
create
> new ones upon next launch, and they are stored in that user's home
> directory.
>
> yes. I'm mostly interested in the Safari cache.
>
> >So you can wild card or loop it for user's that are located in
/Users and
> exclude shared if need be.
>
> Casper policy is set to execute on login, frequency ongoing, scope
for all
> desired machines, and the script is specified in the Scripts tab.
>
> Do I have to specify any of the extra paramter options?
>
>
>
> Gene Anderson
> Systems Analyst, ACTC, MCP
> Pembina Hills Regional Division No.7
> Phone: (780) 674-8535 ext 6860
> email: ganderson at phrd.ab.ca
>
> "Passwords are like bubble gum, strongest when fresh, should never
be
> used by groups and create a sticky mess when left laying around"
>
> -anon
>
>
> _______________________________________________
> Casper mailing list
> Casper at list.jamfsoftware.com
> http://list.jamfsoftware.com/mailman/listinfo/casper
>



More information about the Casper mailing list