Skip to content

Instantly share code, notes, and snippets.

@monkyz
Created September 7, 2012 21:59
Show Gist options
  • Save monkyz/3670077 to your computer and use it in GitHub Desktop.
Save monkyz/3670077 to your computer and use it in GitHub Desktop.
drupal permissions script
#!/bin/bash
USER="user"
DOMAIN="DOMAIN"
#set the site here
SITE="/home/$USER/public_html/$DOMAIN"
# group is apache user (ex: www-data)
USER=$USER:www-data
chown -R $USER $SITE
# set permissions for all directories
find $SITE -type d -exec chmod 755 {} \;
# set permissions for all files
find $SITE -type f -exec chmod 644 {} \;
# set permissions for boost cache
find $SITE/cache -type d -exec chmod 775 {} \;
# set permissions for boost cache
find $SITE/cache -type f -exec chmod 664 {} \;
# set permissions for all directories inside of sites/default/files
find $SITE/sites/default/files -type d -exec chmod 775 {} \;
# set permissions for files inside of sites/default/files
find $SITE/sites/default/files -type f -exec chmod 664 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment