Skip to content

Commit

Permalink
Merge pull request #375 from mariux64/add-cron-micprocess-perm-fix
Browse files Browse the repository at this point in the history
add chmod g+rwx for /project/micprocess
  • Loading branch information
wwwutz authored Mar 21, 2024
2 parents 010a733 + 140f3ff commit a354758
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libexec_cron/prj_micprocess_cleanperm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
set -u
P=/project/micprocess
G=miprogrp
[ ! -d "${P}/home" ] && exit 1
mkdir -p "${P}/home/cron"
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

0 comments on commit a354758

Please sign in to comment.