CHOWNING entire server's files.

Hi guys,
I have used alot of small scripts I wrote in shell, to copy files from one directory into 300+ hard coded directories on the server, problem is, they are all owned by "root".

How can I chmod all directories and files in them (websites) on the server to their original user's access settings, very easily.

It was a pain to hard code to copy to all 300 dirctories and it will be a REAL pain to chown all 300 directories to each of their user names.

Something that really bothers me is that I'm always adding more websites/domains and I have to manually add/hard code the new folder paths. Is there a way to automate this somehow, or using cpanel what can I do?

Thank you.

 

 

 

 

Top