Checking and chaning directory permissions automatically


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Checking and chaning directory permissions automatically
# 1  
Old 04-29-2005
Checking and chaning directory permissions automatically

Hi all,
My first post here.

I need a small script to check the directory permssions on my /home/uploads and if there are any newly created directory in uploads chmod them to 1777.

The upload directory is for my users who upload their pictures and I by default their directories are given 755. I dont' want to use umask as uploads is the only directory to be checked.

Does anyone know/have a bash script for doing this?
I'd appreciate any help. I've done my search but found nothing.
# 2  
Old 05-01-2005
one command will do the trick

Code:
find /home/upload -type d -exec chmod 1777 {} \;

This will change the perms of all the directories to 1777 - even if they were already set to 1777.
# 3  
Old 05-03-2005
Thanks blowtorch,

So, basically I can just do:

chmod -R 0777 /home/uploads
# 4  
Old 05-03-2005
Quote:
Originally Posted by apachi
Thanks blowtorch,

So, basically I can just do:

chmod -R 0777 /home/uploads
blowtorch's code selects only directories under /home/uploads to chmod ... your code chmods everything under /home/uploads ... not quiet the same ...
# 5  
Old 05-05-2005
I see.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Directory Permissions for 2 users on 1 directory

we want to allow user to FTP files into a directory, and then the program (PLSQL) will read and process the file, and then move the file to other directory for archiving. the user id: uftp1, group: ftp the program run in oracle database, thus have the user Id: oraprod, group: dba how to... (2 Replies)
Discussion started by: siakhooi
2 Replies

2. Shell Programming and Scripting

Checking directory permissions on UNIX directory

Hi, How do i check if I have read/write/execute rights on a UNIX directory? What I'm doing is checking read access on the files but i also want to check if user has rights on the direcory in whcih these files are present. if then...... And I check if the directory exists by using... (6 Replies)
Discussion started by: chetancrsp18
6 Replies

3. Shell Programming and Scripting

Automatically execute all programs in a directory

Hello. The last days I extended an open-source C++ library by some faster functions. This library provides a lot of short test programs which guarantee that the library works exactly. The compilation of each test works in a Makefile automatically. What I need is a shell script which... (5 Replies)
Discussion started by: max3000
5 Replies

4. Shell Programming and Scripting

checking Permissions of file for OTHERS and GROUP

Hi, Is their a way to check the read and execute permission on a file on OTHERS and GROUP rwxr--r-x I am trying something like: if ( || ) then .... fi The code above only checks the permissions of the owner of the file but not for the GROUP and OTHERS. I will really... (5 Replies)
Discussion started by: rkumar28
5 Replies

5. Shell Programming and Scripting

Automatically Load data from all files in directory

I'm new in Unix shell scripting and i need someone to help me to make Script that run all time watching my directory that files uploaded to it via FTP (/mydir/incoming_files), if any files exists in it then (if many files exists, then sort files and load them ascending) it‘ll checks the size of the... (1 Reply)
Discussion started by: m_fighter
1 Replies

6. UNIX for Dummies Questions & Answers

checking permissions security

Can you help me to find a way to check that the level of the permissions givven to Others is not higher then the permission given to Group that is not higer from Owner permissions ? (3 Replies)
Discussion started by: ynixon
3 Replies

7. Shell Programming and Scripting

checking for permissions of a file

Hi, I have a script called check.sh. I have to pass a file as input to this script. How can I validat whether the file has read permissions or not within the script. Thanks in advance (1 Reply)
Discussion started by: sendhilmani123
1 Replies

8. Shell Programming and Scripting

determine owner directory permissions from within the directory

From within a directory, how do I determine whether I have write permission for it. test -w pwd ; echo ? This doesn't work as it returns false, even though I have write permission. (4 Replies)
Discussion started by: Sniper Pixie
4 Replies

9. Shell Programming and Scripting

Removing files automatically from a directory after 30 days.

Hello; I have a directory that is collecting log and act files. I need to write a script that will remove these files once they are 30 days old. I have read through a number of threads on this site that have given me a great deal of information. However I have what seems to be a unique... (7 Replies)
Discussion started by: justinb_155
7 Replies

10. Shell Programming and Scripting

checking file's permissions and change them

Hi all, I am very new to UNIX and Shell scripting, I need to run a script to check for file's and directoires permissions and change the permissions if necessary. I appreciate your help.. Thanks (7 Replies)
Discussion started by: K-ONE
7 Replies
Login or Register to Ask a Question