Script to Clear Dropbox Cache

I store an encrypted sparseimage file on my Dropbox for security. As of a few weeks ago, I started getting a problem where my hard drive space was filling up quickly. It turns out that Dropbox was storing multiple copies of it in a folder called “.dropbox.cache”. According to the forums, this is a bug that was fixed years ago, but it seems to have come back.

I’ve reached out to Dropbox for a fix, but, until then, here’s an AppleScript you can run to clear the cache. It quits Dropbox first for safety, clears the cache, then reopens Dropbox. I saved it as an application and put it in my dock so I can run it in one click any time I’m running low on hard drive space.

WARNING: I don’t provide any warranty for this code. It deletes files off of your hard drive without warning. It shouldn’t cause any problem, but if it does, I can’t take any responsibility for it. Understand the code and use it with caution.


tell application "Dropbox"
quit
end tell
do shell script "rm -fr ~/Dropbox/.dropbox.cache/*"
tell application "Finder"
open application file "Dropbox.app" of folder "Applications" of startup disk
end tell

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: