Write the Code. Change the World.

12月 09

mac lightroom 遇到了用户权限问题Lightroom 问题。可以这样操作

# 新建一个 ps.sh 文件,写入以下脚本

#!/bin/bash
# reclaim Inactive memory due to memory leaks by Jenkins

echo === `date`

id=`id -u -nr`

home=/Users/$id

declare -a arr=( "Documents/Adobe/" "Library/Preferences/Adobe/" "Library/Caches/Adobe/" "Library/Application Support/Adobe/" )

for i in "${arr[@]}"
do
   echo "----------------------------------"
   echo "Process folder: $home/$i"

   echo "Restore owner: sudo chown -R $id $home/$i"
   sudo chown -R $id "$home/$i"

   echo "Restore read/write permission: chmod -RL +rwX $home/$i"
   chmod -RL +rwX "$home/$i"

   echo "Remove ACL: chmod -RN $home/$i"
   chmod -RN "$home/$i"
done

# 然后执行它
bash ps.sh