Skip to content

Instantly share code, notes, and snippets.

@matglas
Created September 3, 2013 06:34
Show Gist options
  • Save matglas/6420347 to your computer and use it in GitHub Desktop.
Save matglas/6420347 to your computer and use it in GitHub Desktop.
Reset Drupal code base file permissions.
#!/bin/bash
cd `drush dd`
sudo chown [user]:[group] -R .
sudo find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
sudo find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
cd sites
for d in ./*/files
do
find $d -type d -exec chmod ug=rwx,o= '{}' \;
find $d -type f -exec chmod ug=rw,o= '{}' \;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment