umask for cron

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: plug@arcticmail.complugarcticmail.com
Date:  
Subject: umask for cron
This is a pure GUESS. Unless the cron binary itself
sets the umask ("Use the source, Luke!") before running
an entry in a crontab, my suspicion would be that the
umask would be whatever the umask is when cron is started
in the startup scripts. If it is in the cron binary,
I would hope that it's not hardcoded, but rather there's
a cron config file lying around in /etc somewhere that
could set things like PATH and umask and whatnot.

For giggles, you could try setting umask in the
/etc/init.d/cron before the cron binary is executed.


D

* On Thu, Mar 15, 2001 at 11:51:25AM -0700, Bill Warner wrote:
> Where does cron get its umas settings from?
>
> it doesn't seem to get it from
> /etc/profile
> /etc/bashrc
> /etc/bash_profile
> /etc/<any other regular login scripts i have searched through>
> ~/.profile
> ~/.bashrc
> ~/.bash_profile
> ~/.<any other regular login scripts i have searched through>
>
> is there a default system umask set anywhere for what permissions
> files will be created with? or is it only done in the source code of the
> program? and is there any way to overide it in cron other than running
> programs within a shell script and changing the umask within the script?
>
> useing the script method would mean doing it for each and every cron job
> ~1000 for one of our servers.
>
> Any help would be great
> thanks
>
>
>
>
> --
> --
> Bill Warner
> Direct Alliance Corp.
> Unix/Linux Admin.