Last active
January 3, 2016 16:29
-
-
Save simlun/8489781 to your computer and use it in GitHub Desktop.
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).
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
#!/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