Skip to content

Instantly share code, notes, and snippets.

@freephile
Created September 16, 2017 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freephile/f99274dc53deb2daa1440247665aa0e6 to your computer and use it in GitHub Desktop.
Save freephile/f99274dc53deb2daa1440247665aa0e6 to your computer and use it in GitHub Desktop.
Fix any permission problems in the upload filesystem
cat ./src/scripts/fix.perms.sh.j2
#!/bin/bash
# This script will fix all permissions in the uploads directory
# Since thumbs are included, this will allow missing thumbs to be created
# by RunJobs.php
uploads= {{ m_uploads }} # e.g. /opt/data-meza/uploads-gluster/
time sudo chown -R apache:apache "$uploads"
time sudo find "$uploads" -type d -exec sudo chmod u=rwx,g+rwxs,o=rx {} \;
time sudo find "$uploads" -type f -exec sudo chmod ug=rw,o=r {} \;
############################################################################
cat ./src/scripts/fix.perms.sh
#!/bin/bash
# This script will fix all permissions in the uploads directory
# Since thumbs are included, this will allow missing thumbs to be created
# by RunJobs.php
uploads=/opt/data-meza/uploads-gluster/
time sudo chown -R apache:apache "$uploads"
time sudo find "$uploads" -type d -exec sudo chmod u=rwx,g+rwxs,o=rx {} \;
time sudo find "$uploads" -type f -exec sudo chmod ug=rw,o=r {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment