<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: default umask for cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189721#M689435</link>
    <description>&amp;gt;but I changed it on a test server, rebooted, and my "test touch" entry still had 022&lt;BR /&gt;&lt;BR /&gt;Ah, it is hardcoded in cron(1).&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: see the 'proto(4)' manpages for more details.&lt;BR /&gt;&lt;BR /&gt;It seems proto(4) is only for at/batch.</description>
    <pubDate>Thu, 01 May 2008 20:10:55 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-05-01T20:10:55Z</dc:date>
    <item>
      <title>default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189709#M689423</link>
      <description>I will be changing the umask setting in /etc/profile to be more restrictive. In running some simple tests in cron, to test the impact of this change, I noticed that even though umask was set to 027 in /etc/profile, new file permissions were rw-r--r-- in running a "touch" command in roots cron. This is on an HPUX server.&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 30 Apr 2008 15:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189709#M689423</guid>
      <dc:creator>Luis Toro</dc:creator>
      <dc:date>2008-04-30T15:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189710#M689424</link>
      <description>Cron does NOT source any profiles, /etc/profile or ~/.profile.  &lt;BR /&gt;&lt;BR /&gt;If you want a specific umask in your cron scripts you need to set it manually in the scripts themselves.</description>
      <pubDate>Wed, 30 Apr 2008 15:23:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189710#M689424</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2008-04-30T15:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189711#M689425</link>
      <description>Thanks Patrick.&lt;BR /&gt;Perhaps the better question is: where is cron getting its umask?</description>
      <pubDate>Wed, 30 Apr 2008 15:28:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189711#M689425</guid>
      <dc:creator>Luis Toro</dc:creator>
      <dc:date>2008-04-30T15:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189712#M689426</link>
      <description>&amp;gt;Perhaps the better question is: where is cron getting its umask?&lt;BR /&gt;&lt;BR /&gt;You should just set umask the way you want it in your scripts as Patrick said.&lt;BR /&gt;&lt;BR /&gt;Otherwise cron is started from rc, which is started from inittab.</description>
      <pubDate>Thu, 01 May 2008 05:00:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189712#M689426</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-05-01T05:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189713#M689427</link>
      <description>I think i got your question,&lt;BR /&gt;Patrick is absolutely right when he says cron does not refer any .profile file,you have to put in cron script.&lt;BR /&gt;&lt;BR /&gt;Dennis&lt;BR /&gt;&amp;gt;Otherwise cron is started from rc, which is started from inittab&lt;BR /&gt;&lt;BR /&gt;Lis question is if he is running touch from cron entry file has permission 644.&lt;BR /&gt;So from where this permission is coming.&lt;BR /&gt;&lt;BR /&gt;I think its the default one 022 as said by Dennis.Cron start from rc.&lt;BR /&gt;When u change umask for root or someone from .profile it would be effective only for that login.&lt;BR /&gt;BR,&lt;BR /&gt;Kapil</description>
      <pubDate>Thu, 01 May 2008 05:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189713#M689427</guid>
      <dc:creator>Kapil Jha</dc:creator>
      <dc:date>2008-05-01T05:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189714#M689428</link>
      <description>Now m confused with your error , default mask should come from /etc/profile(global)&lt;BR /&gt;and I think cron should take default from this only.&lt;BR /&gt;Can you please check once again entries you have in /etc/profile.&lt;BR /&gt;BR,&lt;BR /&gt;Kapil</description>
      <pubDate>Thu, 01 May 2008 05:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189714#M689428</guid>
      <dc:creator>Kapil Jha</dc:creator>
      <dc:date>2008-05-01T05:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189715#M689429</link>
      <description>&amp;gt;Kapil: Now I'm confused with your error&lt;BR /&gt;&lt;BR /&gt;Why?  You said exactly what umask was, 022.  This is hardcoded in /sbin/rc.&lt;BR /&gt;And that matches with what Luis said touch did.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;default mask should come from /etc/profile&lt;BR /&gt;&lt;BR /&gt;But it gets reset by rc(1m).&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I think cron should take default from this only.&lt;BR /&gt;&lt;BR /&gt;No, cron gets it from rc.</description>
      <pubDate>Thu, 01 May 2008 05:58:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189715#M689429</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-05-01T05:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189716#M689430</link>
      <description>So it moves like&lt;BR /&gt;rc &amp;gt; /etc/profile &amp;gt; HOME/.profile&lt;BR /&gt;&lt;BR /&gt;if /etc/profile and HOME/.profile does not have any specified  umask then default would come from rc.&lt;BR /&gt;Right...&lt;BR /&gt;&lt;BR /&gt;Kapil</description>
      <pubDate>Thu, 01 May 2008 06:30:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189716#M689430</guid>
      <dc:creator>Kapil Jha</dc:creator>
      <dc:date>2008-05-01T06:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189717#M689431</link>
      <description>&amp;gt;Kapil: So it moves like&lt;BR /&gt;&amp;gt;rc &amp;gt; /etc/profile &amp;gt; HOME/.profile&lt;BR /&gt;&lt;BR /&gt;Why?&lt;BR /&gt;&lt;BR /&gt;It moves like: maybe /etc/profile &amp;gt; HOME/.profile&lt;BR /&gt;rc &amp;gt; umask 022 &amp;gt; /sbin/rc.utils, rc.config&lt;BR /&gt;&amp;gt;&amp;gt; rc scripts&lt;BR /&gt;&lt;BR /&gt;&amp;gt;if /etc/profile and HOME/.profile &lt;BR /&gt;&lt;BR /&gt;Why would these be looked at after rc starts?</description>
      <pubDate>Thu, 01 May 2008 06:55:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189717#M689431</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-05-01T06:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189718#M689432</link>
      <description>Kapil:&lt;BR /&gt;"if /etc/profile and HOME/.profile does not have any specified umask then default would come from rc.&lt;BR /&gt;Right..."&lt;BR /&gt;&lt;BR /&gt;and cron *doesn't* login, so it doesn't use the profiles....which is why its set to the default....</description>
      <pubDate>Thu, 01 May 2008 13:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189718#M689432</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-05-01T13:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189719#M689433</link>
      <description>Thanks for the replies. I know that you can and should source in things like umask in cron entries. The reason for my question is that I need to make the default umask in /etc/profile 027 for every server (audit). And I wanted to make sure that in doing so, I would not impact those cron entries (and there are a lot) from lazy application groups ;-) that do not source in anything.&lt;BR /&gt;So it would seem that making the change in /etc/profile would not imnpact cron jobs. Now the admin in me wants to provide further comfort to the app teams, and state that the cron umask is controlled by [fill in answer here]. I thought /sbin/rc was it, but I changed it on a test server, rebooted, and my "test touch" entry still had 022 (rw-r--r--) (yes, I removed the file prior to the test). I started researching the .proto file in /var/adm/cron, but the umask there is a variable ($m). 10 points for the answer.</description>
      <pubDate>Thu, 01 May 2008 15:08:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189719#M689433</guid>
      <dc:creator>Luis Toro</dc:creator>
      <dc:date>2008-05-01T15:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189720#M689434</link>
      <description>Hi Luis:&lt;BR /&gt;&lt;BR /&gt;Yes, see the 'proto(4)' manpages for more details.&lt;BR /&gt;&lt;BR /&gt;You can alter the 'cron' or 'at' task's umask as demonstrated below.  In these cases, I let the output be mailed to the account originator:&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/mything&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;echo ok&lt;BR /&gt;umask&lt;BR /&gt;&lt;BR /&gt;# umask 077;at -f /tmp/mything 1236&lt;BR /&gt;&lt;BR /&gt;[mail result was]&lt;BR /&gt;ok&lt;BR /&gt;077&lt;BR /&gt;&lt;BR /&gt;# crontab -l&lt;BR /&gt;37 * * * * umask 077 &amp;amp;&amp;amp; /tmp/mything&lt;BR /&gt;&lt;BR /&gt;[mail result was]&lt;BR /&gt;ok&lt;BR /&gt;077&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 01 May 2008 15:44:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189720#M689434</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-05-01T15:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: default umask for cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189721#M689435</link>
      <description>&amp;gt;but I changed it on a test server, rebooted, and my "test touch" entry still had 022&lt;BR /&gt;&lt;BR /&gt;Ah, it is hardcoded in cron(1).&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: see the 'proto(4)' manpages for more details.&lt;BR /&gt;&lt;BR /&gt;It seems proto(4) is only for at/batch.</description>
      <pubDate>Thu, 01 May 2008 20:10:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/default-umask-for-cron/m-p/4189721#M689435</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-05-01T20:10:55Z</dc:date>
    </item>
  </channel>
</rss>

