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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.