File creation permissions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers File creation permissions
# 1  
Old 12-28-2009
File creation permissions

Hi Guys,
Am new worker with the AIX , i need your help please.

i have an AIX server , and i have folder with permission 775 . i need any file that added to this folder to get the same permission of the folder (755) . this folder is used for auditing . users used to delete the files in the folder daily and new files will be added automatically.

please assist me.
# 2  
Old 12-28-2009
You need to set umask to 002 prior to creating the file:
Code:
umask 002

This way any new file will get permission 664. If the newly created files needs to be executable too, you have to do this manually after creating the file by using chmod.:
Code:
chmod +x file

# 3  
Old 12-28-2009
Scrutinizer , thank you

but i can not did these steps manually every time files added . i need an automatic method
# 4  
Old 12-28-2009
If you have superuser access then you can set the defaults for users in

/etc/security/user
# 5  
Old 12-28-2009
Quote:
Originally Posted by abu7maid2005
Scrutinizer , thank you

but i can not did these steps manually every time files added . i need an automatic method
Only now I notice you say files need to be created 755. I presume you mean 775 and also that 664 will be enough? I am wondering why you need to create these files 664? Suppose users create files there with permssions 644. Other users that are member of the group that owns the directory will still be able to remove the file.
# 6  
Old 01-03-2010
Quote:
Originally Posted by Scrutinizer
Only now I notice you say files need to be created 755. I presume you mean 775 and also that 664 will be enough? I am wondering why you need to create these files 664? Suppose users create files there with permssions 644. Other users that are member of the group that owns the directory will still be able to remove the file.
yes , i want all the user in the group to use the directory .

to be more clear , i need to make recursive permission . ( any file is added to the folder should be assigned the same folder permissions)

Thank you all
# 7  
Old 01-03-2010
If you cannot have your users use a script when they create files in your directories, then maybe you can run a cron job every 5 minutes that would run in the background to change file permissions. This script would need to run as root. Would something like that work for you?

Without more information it is not possible to write the script. Would these files live under a common tree? If these directories are not colocated, is is possibe to get a list of directories to check?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print the specific part of the file name with file creation date?

Hello Folks, I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern. Filename: MobileProtocol.20171228T154200.157115.udr I want to get the count of files created on each day based on a pattern find. find . -type... (7 Replies)
Discussion started by: sadique.manzar
7 Replies

2. Shell Programming and Scripting

Tar file creation

Hi, I need to transfer some files from one server to another server. I need confirmation whether tar file will be created or not in HP UX with the following space details. du -s /home/webadmin/xxx/bin/ 469186 /home/webadmin/xxx/bin/ df -k /home/webadmin/xxx/bin/ 556110 total... (5 Replies)
Discussion started by: nag_sathi
5 Replies

3. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

4. Shell Programming and Scripting

File creation

Hi I need to write a file with value value from Paramer which is passed from datastage. It should overwrite the file if already exists. Can anybody provide command for this? (1 Reply)
Discussion started by: cnrj
1 Replies

5. Shell Programming and Scripting

Help with creating a text file in perl with file creation date.

Hi, I am quite new to Perl scripting and i need to create a .TXT file using perl, with fields (A,B,C,D,E), and this text file should be named with current file creation date "XYZ_CCYYMMDD.TXT" (i.e.XYZ_2011042514:33 PM). Can anyone who has done this, please share their expertise on this... (5 Replies)
Discussion started by: msrahman
5 Replies

6. Solaris

gzip a file and append creation date stamp to file

I want to gzip a file and append the creation date to the end of the file. How can I accomplish this task. Basically they are log files which need a creation date stamp appended to make sure they do not overwrite other log files. -jack (3 Replies)
Discussion started by: jacktravine
3 Replies

7. UNIX for Advanced & Expert Users

file creation

Hi, Is there any way to restrict directories with one type of file creation. regards. (8 Replies)
Discussion started by: guguli
8 Replies

8. Shell Programming and Scripting

file creation

hi guys Kindly see the below script #!/bin/bash if then # check to see if file notrouter exits or not if ! ls -l notrouter /root/joy/ >/dev/null then touch /root/joy/notrouter else echo "Entries already exist" fi else echo "Entries does not exist" fi here... (1 Reply)
Discussion started by: whizkidash
1 Replies

9. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

10. Linux

creation of a file

how to create a file with the same modification time as another file is having using the copy command? (1 Reply)
Discussion started by: infyanurag
1 Replies
Login or Register to Ask a Question