|
|
Remove Safari history files on logout via shell script
Logout hooks are run as the root user SO ALWAYS USE CAUTION WHEN DOING THIS!. If you want to know what the short user name of the user logging out is, it is stored in the $1 shell variable, so the correct generalized scripts should be:
#!/bin/bash # Clear Safari History (except for bookmarks). /bin/rm -f /Users/$1/Library/Safari/Downloads.plist /Users/$1/Library/Safari/History.plist /bin/rm -f /Users/$1/Library/Safari/HistoryIndex.sk /Users/$1/Library/Safari/TopSites.plist /bin/rm -f /Users/$1/Library/Safari/WebpageIcons.db /Users/$1/Library/Safari/LastSession.plist # Add any additional clean-up here.Also you should use the full path to the rm command so you know you are getting the correct version. Also you may want to add in the /bin/rm -f /Users/$1/Library/Caches/com.apple.Safari/Cache.db /bin/rm -rf /Users/$1/Library/Caches/com.apple.Safari/Webpage PreviewsFor extra credit, you can set up a user agent to clean up Safari everytime it runs, thats what I do. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|