Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chmod routine 2

Status
Not open for further replies.

BlindPete

Programmer
Jul 5, 2000
711
US
Hello All,

I'm hoping someone has a function they can share to do this for me.

I want to be able CHMOD(666) or CHMOD(777) an entire directory branch, including all files and sub folders.

Its an APACHE server on a LINUX box.

If anyone has a cron script that would do fine.

thanks a bunch!

-Pete
Do you get a little guilty pleasure when a celebrity has a bad day?
Well then The Dead Pool is for you!
 
This can be easily done with system commands, and as such I don't think a PHP script would be better. The PHP would also just work if the command line version of PHP is installed.
IMO you are much better off with a regular chron job that uses find, something like
Code:
find . -type -f -exec chmod 666 {}\;
 
I agree on the 777. the path in question is also htaccess protected

help me out alittle more with the cron. I'm really bad at it.

say my parent path is:
\public_html\files
under that is much directory structure and many files that I want to CHMOD 666

so would the CRON line look like this?
Code:
find \public_html\files\. -type -f -exec chmod 666 {}\;



-Pete
Do you get a little guilty pleasure when a celebrity has a bad day?
Well then The Dead Pool is for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top