Skip to content

Instantly share code, notes, and snippets.

@ggilder
Created October 27, 2012 21:31
Show Gist options
  • Save ggilder/3966379 to your computer and use it in GitHub Desktop.
Save ggilder/3966379 to your computer and use it in GitHub Desktop.
Check for files affected by Dropbox bug
#!/usr/bin/env bash
# Dropbox apparently has a potential bug where files can be zeroed out.
# Description here:
# http://konklone.com/post/dropbox-bug-can-permanently-lose-your-files
#
# The script in that article to detect zero-byte files is pretty naive about
# files that normally would be zero bytes, so here's an improved version that
# ignores some common cases:
# - Mac OS icons
# - .gitkeep files
# - lock files
# - iOS thumbnail cache files
# - Anything with a resource fork (old Mac OS PostScript fonts, AppleScripts,
# etc.)
#
# DO NOT COPY AND PASTE THIS!!! There is a control character that probably
# won't come through correctly. Instead save the file and run:
# bash dropbox_empty_files.sh
find ~/Dropbox -size 0 -not -name 'Icon ' -not -name '.gitkeep' -not -name '*-lock' -not -name '*.ithmb' -not -xattrname com.apple.ResourceFork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment