我在 /root/prepare_server.sh 中为我的开发人员制作了一个脚本
#!/bin/bash
FILES="/var/www/html/crm/cicrm/cache/
/var/www/html/crm/cicrm/data/
/var/www/html/crm/cicrm/logs/
/var/www/html/crmtest/cicrm/cache/
/var/www/html/crmtest/cicrm/data/
/var/www/html/crmtest/cicrm/logs/"
for f in $FILES
do
echo "processing $f" 1>&2
if [[ ! -e $f ]]; then
mkdir $dir
elif [[ ! -d $f ]]; then
echo "$f already exists but is not a directory" 1>&2
fi
done
chown -R manager:phpdev /var/www/html/crm/
chown -R manager:phpdev /var/www/html/crmtest/
chown -R manager:phpdev /var/redmine/crmGit/
chown -R manager:phpdev /var/redmine/owncloudGit/
chmod -R 770 /var/redmine/crmGit/
chmod -R 770 /var/redmine/owncloudGit/
chmod -R 770 /var/www/html/crm/
chmod -R 777 /var/www/html/crm/cicrm/cache/
chmod -R 777 /var/www/html/crm/cicrm/data/
chmod -R 777 /var/www/html/crm/cicrm/logs/
chmod -R 770 /var/www/html/crmtest/
chmod -R 777 /var/www/html/crmtest/cicrm/cache/
chmod -R 777 /var/www/html/crmtest/cicrm/data/
chmod -R 777 /var/www/html/crmtest/cicrm/logs/
整个目录只归我所有:manager:phpdev
通常当我的开发人员使用 git 更新所有文件时,权限会更改为 developer:developer,
我的用户(开发人员:开发人员)如何运行我的脚本?