Skip to content

Instantly share code, notes, and snippets.

@cypres
Created July 1, 2011 15:10
Show Gist options
  • Save cypres/1058743 to your computer and use it in GitHub Desktop.
Save cypres/1058743 to your computer and use it in GitHub Desktop.
fix permissions shell script
#!/bin/sh
/usr/bin/find /var/www -path "/var/www/*/wwwroot/*" \
\( -type f ! -perm 660 -print0 -exec chmod 660 {} \; -exec sh -c exit 1 \; \) -or \
\( -type d ! -perm 770 -print0 -exec chmod 770 {} \; -exec sh -c exit 1 \; \) -or \
\( \( ! -user ftp -or ! -group www \) -print0 -exec chown -f ftp:www {} \; \) > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment