Last active
February 13, 2016 04:39
-
-
Save jaonoctus/bf9647100bc17de036e7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
| path_oc='/root/owncloud' | |
| path_files=${path_oc}'/data/jaonoctus/files' | |
| user='bkp' | |
| group='bkp' | |
| cd $path_oc | |
| chown -R ${user}:${group} ${path_files}/ | |
| chmod 777 -R ${path_files}/* | |
| sudo -u bkp php occ files:scan --all |
This file contains hidden or 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/bash | |
| ocpath='/root/owncloud' | |
| htuser='bkp' | |
| htgroup='bkp' | |
| rootuser='root' | |
| printf "Creating possible missing Directories\n" | |
| mkdir -p $ocpath/data | |
| mkdir -p $ocpath/assets | |
| printf "chmod Files and Directories\n" | |
| find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 | |
| find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 | |
| printf "chown Directories\n" | |
| chown -R ${rootuser}:${htgroup} ${ocpath}/ | |
| chown -R ${htuser}:${htgroup} ${ocpath}/apps/ | |
| chown -R ${htuser}:${htgroup} ${ocpath}/config/ | |
| chown -R ${htuser}:${htgroup} ${ocpath}/data/ | |
| chown -R ${htuser}:${htgroup} ${ocpath}/themes/ | |
| chown -R ${htuser}:${htgroup} ${ocpath}/assets/ | |
| chmod +x ${ocpath}/occ | |
| printf "chmod/chown .htaccess\n" | |
| if [ -f ${ocpath}/.htaccess ] | |
| then | |
| chmod 0644 ${ocpath}/.htaccess | |
| chown ${rootuser}:${htgroup} ${ocpath}/.htaccess | |
| fi | |
| if [ -f ${ocpath}/data/.htaccess ] | |
| then | |
| chmod 0644 ${ocpath}/data/.htaccess | |
| chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment