LPTech
asked on
umask for cron jobs
Hi,
I am running a RedHat 2.1AS Linux box and I need the default umask to be 002. I set it in /etc/profile and /home/user/.bash_profile for each user; however, when jobs are run by cron as root, the umask doesn't seem to be in effect. Is there any way to make the umask the correct value permanently without actually adding the commands into the scripts run by cron?
Thanks
I am running a RedHat 2.1AS Linux box and I need the default umask to be 002. I set it in /etc/profile and /home/user/.bash_profile for each user; however, when jobs are run by cron as root, the umask doesn't seem to be in effect. Is there any way to make the umask the correct value permanently without actually adding the commands into the scripts run by cron?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
What's your cron script? I assume that is a sh or bash script.
How about /etc/bashrc in addition to /etc/profile and /home/user/.bash_profile?
Wesly
What's your cron script? I assume that is a sh or bash script.
How about /etc/bashrc in addition to /etc/profile and /home/user/.bash_profile?
Wesly
ASKER
It's actually a perl script...
You could call a system command from perl -
system (umask 002);
system (umask 002);
ASKER
Yeah, I was hoping to not have to make a code change to the script due to source control\testing problems... Adding the umask 002 to the crontab works perfectly. =P
ASKER