Created
September 30, 2015 12:15
-
-
Save andrius/7de1623bd6478bd912b2 to your computer and use it in GitHub Desktop.
Fixes file permissions in Dropbox folder (windows make them wrong)
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/sh | |
cd ~/Dropbox | |
# Remove conflicted copies | |
find . -iname '*conflicted copy*' | \ | |
awk -F '-8-8-8-8-8-' '{print "\""$1"\""}' | xargs rm -rf | |
find . -type f \ | |
-perm 755 \ | |
-not -path "*/bin/*" -not -path "*/script/*" -not -iname "*.sh" \ | |
-print -exec chmod 644 {} \; | |
find Code -type f \ | |
-not -path "*.git/*" -and \ | |
-path "*/bin/*" -or -path "*/script/*" -or -iname "*.sh" \ | |
-print -exec chmod 755 {} \; | |
find Projects -type f \ | |
-not -path "*.git/*" -and \ | |
-path "*/bin/*" -or -path "*/script/*" -or -iname "*.sh" \ | |
-print -exec chmod 755 {} \; | |
find Provisioning -type f \ | |
-not -path "*.git/*" -and \ | |
-path "*/bin/*" -or -path "*/script/*" -or -iname "*.sh" \ | |
-print -exec chmod 755 {} \; | |
find Shared -type f \ | |
-not -path "*.git/*" -and \ | |
-path "*/bin/*" -or -path "*/script/*" -or -iname "*.sh" \ | |
-print -exec chmod 755 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment