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!

Change Permissions on Files Automatically 2

Status
Not open for further replies.

knowlgo

MIS
Dec 27, 2004
17
US
I read through many of the threads so as to avoid redundancy, so if this is somewhere else please excuse my ignorance.

I need to chmod every file that enters a directory so it is globally writable. Do I need to set up a cron for this? Is there a way to set up the directory so every file is writeable?

Thank you.
 
You need to change the UMASK setting of whatever process creates those files. That would be the easy way.
Using CRON would be another. The entry would be similar to:

0,30 * * * * /bin/chmod 666 /yourdirectory/*

This would run through that directory every 30 minutes and change permissions.
 
I'd replace 666 by ugo+w

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How about turning on a sticky bit on the directory itself?
 
Thanks for the quick response. I added the following entry to cron, to run every 5 minutes but it didn't change the permissions in the directory (I actually had a prefix that I added in for specific files to change). I'm sure there's some small detail that I've missed.

I haven't used the cron before. but the structure of having the chmod command followed by the directory path looks strange. Did I perhaps misinterpret something in the explanation? Thanks again.

5,10,15,20,25 * * * * /bin/chmod ugo+w/dir/dir/dir/dir/file*
 
/bin/chmod ugo+w[highlight] [/highlight]/dir/dir/dir/dir/file*

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
HEY!!!! It just worked. Awesome. Thanks for the responses.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top