我想要使用以下腳本遍歷/ Volumes/Volume-B/Exchange中的所有子文件夾,並應用這些ACL和權限更改,但不會將其應用於/ Volumes/Volume -B/Exchange父文件夾。遍歷子文件夾並運行
某種循環,通過子文件夾循環就是我卡上...如何實現這種清潔大加讚賞
建議!
#!/bin/bash
PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH
DEST=/Volumes/Volume-B/Exchange
LOG=/var/log/fixperms-exchange.log
{
echo ""
echo "Begin Fixing perms on $DEST at `date`"
chmod -R +a "studiostaff allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" "$DEST"
chmod -R +a "studiostaff inherited allow read,write,execute,delete,append,readattr,writeattr,readextattr,writeextattr,readsecurity" "$DEST"
chown -R padmin:staff "$DEST"
echo "Permissions fix complete at `date`"
echo ""
} >> $LOG 2>&1
是的,那正是我在找的,謝謝! – Dan