Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compare MD5 checksums for all files in a local Dropbox directory with a remote one. Use for example to reconcile your Dropbox directory between your laptop and workstation. You will be surprised over what you may find... Script was written for Mac OS X. You must of course have "Remote Login" enabled (System Preferences/Sharing).
#!/bin/bash -ex
#
# Example usage:
# $ ./dropbox-reconciliation.sh 192.168.0.17
#
REMOTE_HOST=$1
EXCLUDES="-name '*.DS_Store' -or -path './.dropbox.cache*' -or -name 'Icon*' -or -name .dropbox"
EXEC="-type f -exec md5 -r \"{}\" \;"
FIND="find . \! \( $EXCLUDES \) $EXEC"
diff <(cd ~/Dropbox; bash -c "$FIND") \
<(ssh $REMOTE_HOST "cd ~/Dropbox; bash -c \"$FIND\"") \
| less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.