Operating System - HP-UX
1825793 Members
2229 Online
109687 Solutions
New Discussion

Default for a cron scheduled process

 
SOLVED
Go to solution
Tim Rotunda
Frequent Advisor

Default for a cron scheduled process

I am having a problem with a cron scheduled job that fires off processes (C and FORTRAN) which creates directories and files. The permissions of the resulting files and directories do not have the permissions that I expect them to have. The processes do not set the permissions on each created file or directory, so how does a cron scheduled process determine the FMC mask it will use for a default? Any assistance is greatly appreciated.
TR.a
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: Default for a cron scheduled process

Tim:

I suspect that you normally establish your 'umask' in your '.profile'. Cron only supplies default environmental values for your HOME, LOGNAME, PATH and SHELL. You must either source your .profile or define the your variables "of interest" in the script that cron executes. In your case, it sounds like simply setting the 'umask' in the cron'ed script is the appropriate choice.

...JRF...
Matt Livingston
Valued Contributor

Re: Default for a cron scheduled process

If for some reason, you cannot or do not want to edit the scripts that cron fires off, you can source your .profile within the crontab entry with normal command stacking.

e.g.

00 03 * * 1-5 . .profile; my_fortran_program