In my /etc/hosts file, I have records like this:
127.0.0.1 www.youtube.com
To keep me from getting distracted. When I need something on one of the sites I have blocked, I add # to the beginning of the line. Running this command, I can make it so all of the lines can be uncommented to remove access again:
sudo sed -i '' 's/\#//g' /etc/hosts
To automatically remove access, I run sudo crontab -e
and add this line
*/10 8-15 * * 1-5 sed -i '' 's/\#//g' /etc/hosts
I also tried with sudo crontab -e -u root
After saving it, mac asks for permission for terminal to admin the machine, which I grant, and I figure it should be all good, but it doesn't see that the command is ever run (the file doesn't get updated). Is there something I need to do to get it to update the file?