Why crontab umask not using default?

Solution Verified - Updated -

Issue

  • When a file is created by root it shows permissions 644, but when the file is created by cronjob in the same path it shows 640 permissions (expected permissions are 644).
user: root
umask: 0022
/etc/crontab is default.

[root@server ~]#  rpm -qa cronie*
cronie-1.4.4-12.el6.x86_64
cronie-anacron-1.4.4-12.el6.x86_64
[root@server ~]# umask
0022
[root@server ~]#  /bin/ls -l /tmp/crontest/file_by_cron
-rw-r----- 1 root root 0 Oct  3 12:52 /tmp/crontest/file_by_cron

Environment

  • Red Hat Enterprise Linux (RHEL) 6
  • cronie-1.4.4-12.el6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content