Skip to content
Permalink
0708053cdf
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 13 lines (12 sloc) 693 Bytes
#!/bin/bash
P=/project/communication
G=commugrp
[ ! -d ${P}/home ] && exit 1
LOG=${P}/home/cron/cleanperm.sh.log
NOTHOME="-not -regex ${P}/home/?.*"
date >>${LOG}
find ${P}/ -type d -not -perm -2771 ${NOTHOME} -exec chmod -v 2771 {} ';' >>$LOG 2>&1
find ${P}/ -type f -perm -u+x -not -perm -g+x ${NOTHOME} -exec chmod -v ug+x,o-rw {} ';' >>$LOG 2>&1
find ${P}/ -type f -perm -u+rw -not -perm -g+rw -not -perm /u=x ${NOTHOME} -exec chmod -v ug+rw,o-rw {} ';' >>$LOG 2>&1
find ${P}/ -type f -perm -u+rwx -not -perm -g+rwx ${NOTHOME} -exec chmod -v ug+rwx,o-rwx {} ';' >>$LOG 2>&1
find ${P}/ -not -group ${G} -ls -exec chgrp -v ${G} {} ';' >>$LOG 2>&1