Fix file permissions
- Read more about Fix file permissions
- Log in to post comments
#!/bin/bash
for DIR in /media/bilder /media/lagerliste /media/projekte /media/texte; do
    echo ${DIR}
    echo "set owner..."
    find ${DIR} \! -user nobody -exec chown nobody {} \;
    find ${DIR} \! -group nogroup -exec chgrp nogroup {} \;
#    chown nobody:nogroup ${DIR} -R
    echo "set directory permissions..."
    find ${DIR} \! -perm 777 -type d -exec chmod 777 {} \;
#    find ${DIR} -type d -exec chmod 777 {} \;
    echo "set file permissions..."
    find ${DIR} \!