Skip to main content

Trying to have all users' computers restart every morning;

I have a script that kills all processes and restarts after 1minute. I need a script to also remove the cookies, history, and cache of Chrome on said restart so they essentially start "fresh" each day without losing their extensions.

Tried this but it's not working:

!/bin/sh

Remove Google Chrome Browser Cache Cookies and Extension Logins

sudo rm -Rf ~/Library/Caches/Google/Chrome/Default/Cache/
sudo rm -Rf ~/Library/Application Support/Google/Chrome/Default/Cookies/
sudo rm -Rf ~/Library/Application Support/Google/Chrome/Default/Cookies-journal/
sudo rm -Rf ~/Library/Application Support/Google/Chrome/Default/Extension/
sudo rm -Rf ~/Library/Application Support/Google/Chrome/Default/Extension-journal/
sudo rm -Rf ~/Library/Application Support/Google/Chrome/Default/History/
sudo rm -Rf ~/Library/Application Support/Google/Chrome/Default/History-journal/

Thanks

Did you find something already ?


Looking for this exact thing as well.


Me too, as well as Safari data, but I know there are SIP issues relate to that.


This is what I use for Cookies, but could be easily modified to include everything else you need.

#!/bin/bash
## System Variables
USERNAME=`stat -f%Su /dev/console`
COOKIEPATH="/Users/$USERNAME/Library/Application Support/Google/Chrome"

find "$COOKIEPATH" -name Cookies -delete

pkill Google Chrome

I want to do the exact opposite. I want to keep the students from deleting their browsing history. Is that doable 🙂 is there a script for that?


I want to do the exact opposite. I want to keep the students from deleting their browsing history. Is that doable 🙂 is there a script for that?


Check out Chrome Management, there's built-in functionality with JAMF Pro now. which makes enrolling browsers very easy, one of the policies you can set once enrolled is not being able to delete history.

https://www.jamf.com/blog/admin-essentials-simplifying-chrome-deployments-on-macos/ 

https://support.google.com/chrome/a/answer/9923111?hl=en

Have just rolled this out so feel free to shoot through a DM if you have any questions.


Check out Chrome Management, there's built-in functionality with JAMF Pro now. which makes enrolling browsers very easy, one of the policies you can set once enrolled is not being able to delete history.

https://www.jamf.com/blog/admin-essentials-simplifying-chrome-deployments-on-macos/ 

https://support.google.com/chrome/a/answer/9923111?hl=en

Have just rolled this out so feel free to shoot through a DM if you have any questions.


For iPads? IOS


For iPads? IOS


I haven't tried it on iOS but from what i've seen its only for MacOS, Windows, Linux and ChromOS


I haven't tried it on iOS but from what i've seen its only for MacOS, Windows, Linux and ChromOS


I've just checked it out and looks like there is the ability for iOS devices. unsure on the enrolment process for ipads though.