jump to navigation

Deleting Flash Cookies Daily Using Snow Leopard’s Semi-Broken Periodic Scripts September 8, 2009

Posted by Robert Harder in Utility.
Tags: , , , , , , ,

I was trying to find a convenient way to delete Flash cookies every day and wanted to run two simple lines automatically:

rm -rf /Users/rob/Library/Preferences/Macromedia/Flash Player/#SharedObjects
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/flashplayer/sys

There are many ways to do this of course: launchd, cron, at, etc, but I thought it would be most elegant to tie into the Mac’s periodic maintenance scripts, and what a time I had debugging why I couldn’t get it to work.

The script at /etc/periodic/daily/999.local is supposed to execute all scripts residing in the $daily_local variable (set in /etc/defaults/periodic.conf) which is /etc/daily.local by default, but it doesn’t, and I had to change a line in 999.local from this:

for script in $daily_local

to this:

for script in $daily_local/*

Script junkies can see that the original for loop will iterate over exactly one item: the string /etc/daily.local.

With the change, I created a directory at /etc/daily.local and put a simple script in it.

$ sudo mkdir /etc/daily.local
$ sudo vi /etc/daily.local/delete_flash_cookies.sh
$ sudo chmod +x /etc/daily.local/delete_flash_cookies.sh

The script looks like this:

echo ""
echo "Local Script: Removing Flash Cookies:"
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash Player/#SharedObjects
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/flashplayer/sys


Edit /etc/periodic/daily/999.local (and similar scripts for weekly and monthly) to read around line 19:

for script in $daily_local/*

Create a directory at /etc/daily.local.

Add executable scripts to the /etc/daily.local directory.



1. good advice - June 5, 2013

Great article! We will be linking to this particularly great content on our website.
Keep up the great writing.

2. mutual money - June 20, 2013

I got this site from my buddy who informed me concerning this web page and at the moment this time I
am browsing this website and reading very informative content
at this time.

3. http://www.zcpgsksg.com - July 1, 2013

I’m not sure where you’re getting your info, but good topic.
I needs to spend some time learning much more or understanding
more. Thanks for wonderful info I was looking for this info for my mission.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: