php - restore permissions after set by error chmod -R 775 / -


by error set folders , files permissions on 775, executing command

sudo chmod 775 -r /website/folder / 

and need restore server folders , paths permissions @ least centos files, moment can't send emails websites...

system centos 5

thanks...

this not meant complete solution, rather idea how solve this.

you query packet database (in centos afair rpm) , set permissions way meant according database.

some helpful commands rpm:

  • rpm -va verifies files registered in rpm database. files have wrong permissions listed there. files wrong mode displayed m in 2nd column. rpm -va | grep ^.m | cut -c 13- should start.

  • another option query files in packets with

    rpm --queryformat='%{filemodes}\t%{filenames}\n' -qa 

    and process output piping kind of loop such as

    | while read mode fn; chmod -v ... "$fn"; done 

    but here have convert decimal output filemodes octal chmod understands it.

    alternatively, process output else, python script or so, gives finer control on do.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -