Created
October 27, 2012 21:31
-
-
Save ggilder/3966379 to your computer and use it in GitHub Desktop.
Check for files affected by Dropbox bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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