1831207 Members
3082 Online
110021 Solutions
New Discussion

umask problem

 
Claudio_17
Frequent Advisor

umask problem

Hi ,

I've a file created with perm 644 by a job scheduled with autosys .

These are directoy ( /test ) perm where files are created

drwxrwsr-x 3 p01adm daemon 2048

If I do umask while connected like p01adm it return 0113 and if I create under /export/test it's created with 664 permission .

The directory is NFS exported .

Any suggest ?

Thanks




9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: umask problem

umask can not be used to make files automatically executable. You have to do that manually or via cron script after file creation.

The keepers of Unix rightly decided it was a good idea that a human make the decision whether a file should be executabel.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Claudio_17
Frequent Advisor

Re: umask problem

I don't need file to be executable.

Patrick Wallek
Honored Contributor

Re: umask problem

What is your problem? I don't quite understand what you are trying to solve.
Steven E. Protter
Exalted Contributor

Re: umask problem

I misunderstood you.

For 664 permissions you need umask of 002.

You might need that to be the umask on the NFS server too.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Helen French
Honored Contributor

Re: umask problem

If I understood correctly, then a umask value of 0113, will create files with permission - 664. It's as expected.

# man umask
Life is a promise, fulfill it!
Claudio_17
Frequent Advisor

Re: umask problem

Ok..then

a file is created with permission 644 user p01adm and group daemon .

-rw-r--r-- 1 p01adm daemon


This is done by a job scheduled with autosys .

If I connect to system like p01adm user I see umask is 113 and if I create a file I've 664 permission ( that is right becuase of umask 113)

-rw-rw--r-- 1 p01adm daemon


I'm trying to figure out why files created with autosys scheduled job have 644 permission.

Helen French
Honored Contributor

Re: umask problem

For the last question: Check who owns the 'autosys' process and who is the owner of the process that creates your files. Now check the umask value set in that user profile. It might be different from your user 'p01adm'.
Life is a promise, fulfill it!
Zeev Schultz
Honored Contributor

Re: umask problem

Where's the issue?
The only thing I don't like to see it that umask doesn't show SetGID bit (2) so the correct umask should be shown: 2113

The rest is ok,664 maps to umask 113.May be you
try to clarify the problem?

Thanks

Zeev
So computers don't think yet. At least not chess computers. - Seymour Cray
Zeev Schultz
Honored Contributor

Re: umask problem

Hm,post got late after the clarification :)

Ok,I'd also check /etc/profile if default umask 022 was changed by someone (and .profile for p01adm as was mentioned).And look inside your script - it may call another scripts with another owners etc.

So computers don't think yet. At least not chess computers. - Seymour Cray