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:
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/
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
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.
Have just rolled this out so feel free to shoot through a DM if you have any questions.