LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   crontab and umask (https://www.linuxquestions.org/questions/linux-general-1/crontab-and-umask-347255/)

madsjakob 07-27-2005 07:26 AM

crontab and umask
 
After changing the umask in /etc/bashrc and /etc/csh.cshrc from 022 to 002 I'd expect that my scripts would use the new umask. Well they do next time I log in and run them by hand. But the crontab seems to reject the new umask. I have tried to restart the demon. I have even tried to reboot the server. It still uses the old umask. Is there some place special I have to change the umask when running scripts from the crontab?

Thanks

/mj

trickykid 07-27-2005 12:44 PM

What exactly did you place in your /etc/bashrc file and shouldn't that be /home/user/.bashrc ? The default one to use for global setups is /etc/profile

madsjakob 07-28-2005 03:36 AM

Well I figured since the umask already being set in /etc/bashrc with following lines
Code:

if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
    umask 002
else
    umask 022
fi

I might as well change the last umask entry to
Code:

umask 002
anyways the approach is working on other servers set up this way.

BTW all servers are installed with Fedora Core 4 Test (last test release as I recall) and just this one is behaving odd.

Thanks again

/mj


All times are GMT -5. The time now is 02:20 AM.